[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] OpenGL Build Trouble



On Sun, Jul 29, 2007 at 01:06:22PM -0700, Ian Mallett wrote:
> I have this problem too.  If you look carefully at the output from py2exe,
> it says something like: "the following modules do not appear to exist:
> OpenGL.GL, OpenGL.GLU".  I find it annoying, but I don't know how to fix
> it...
> Ian
> 
> On 7/29/07, Kris Schnee <kschnee@xxxxxxxxxx> wrote:
> >
> > I just built an EXE using Pygame and PyOpenGL, and the EXE crashes with
> > this message:
> >
> > Traceback (most recent call last):
> >    File "cubeland.py", line 13, in ?
> >    File "OpenGL\__init__.pyc", line 18, in ?
> >    File "OpenGL\__init__.pyc", line 14, in __set_attributes
> > IOError: [Errno 2] No such file or directory:
> > 'C:\\Python24\\dist\\library.zip\\OpenGL\\version'
> >
> >
> > What do I do about this problem?
> >
Hi,

the above message is indicating that the file 'version' is missing. It
is a result of Py2Exe not detecting that a data file (containing the
version number) is required.

I've seen two solutions. One is to dump the version checking, the other
is to modify the version checking code.

(I can't remember if I tried manually adding the file - maybe it's
there but just not loadable).

I rename 'OpenGL/version' to 'OpenGL/version.py' and have it contain the
following line:

__version__ = "2.0.2.01"

then tweak the '__init__.py' file in 'OpenGL' to do:

def __set_attributes():
...
    import ..., version
...
    __version__ = version.__version__

and then fix-up 'setup/util.py' in a similar manner.

I've got a ZIP archive with the modified files (not a patch,
unfortunately) here:

http://www.johnnypops.demon.co.uk/python/pyopengl-2.0.2.01-version-tweak.zip (1.8K)

which may or may not be the version you are using. This applies to the
pre-ctypes version of PyOpenGL, I don't know about the current version.

Also the full installer with Togl and Numeric-24 support:

http://johnnypops.demon.co.uk/files/PyOpenGL-2.0.2.01-1.py2.4-numpy24.exe (5.1M)

The same page also has an example of using Pygame with PyOpenGL, Py2Exe
and Inno-Setup:

http://www.johnnypops.demon.co.uk/python/index.htm
http://www.johnnypops.demon.co.uk/python/demo-fm-0.0.1-src.zip
http://www.johnnypops.demon.co.uk/python/demo-fm-0.0.1-win32-installer.exe

Hope that helps,

cheers,
John.