3

I'm trying to make lesson18.py from the pyOpenGL examples into an exe but when compiled it gives this error:

Traceback (most recent call last):
  File "<string>", line 46, in <module>
  File "C:\pyinstaller-1.5.1\iu.py", line 436, in importHook
    mod = _self_doimport(nm, ctx, fqname)
  File "C:\pyinstaller-1.5.1\iu.py", line 521, in doimport
    exec co in mod.__dict__
  File "pyinstall\build\pyi.win32\lesson18\outPYZ1.pyz/OpenGL.GL", line 3, in <m
odule>
  File "C:\pyinstaller-1.5.1\iu.py", line 436, in importHook
    mod = _self_doimport(nm, ctx, fqname)
  File "C:\pyinstaller-1.5.1\iu.py", line 521, in doimport
    exec co in mod.__dict__
  File "pyinstall\build\pyi.win32\lesson18\outPYZ1.pyz/OpenGL.GL.VERSION.GL_1_1"
, line 10, in <module>
  File "C:\pyinstaller-1.5.1\iu.py", line 477, in importHook
    mod = self.doimport(nm, ctx, ctx+'.'+nm)
  File "C:\pyinstaller-1.5.1\iu.py", line 521, in doimport
    exec co in mod.__dict__
  File "pyinstall\build\pyi.win32\lesson18\outPYZ1.pyz/OpenGL.arrays", line 22,
in <module>
  File "pyinstall\build\pyi.win32\lesson18\outPYZ1.pyz/OpenGL.arrays.formathandl
er", line 28, in loadAll
  File "pyinstall\build\pyi.win32\lesson18\outPYZ1.pyz/OpenGL.arrays.formathandl
er", line 35, in loadPlugin
  File "pyinstall\build\pyi.win32\lesson18\outPYZ1.pyz/OpenGL.plugins", line 14,
 in load
  File "pyinstall\build\pyi.win32\lesson18\outPYZ1.pyz/OpenGL.plugins", line 28,
 in importByName
  File "C:\pyinstaller-1.5.1\iu.py", line 436, in importHook
    mod = _self_doimport(nm, ctx, fqname)
  File "C:\pyinstaller-1.5.1\iu.py", line 521, in doimport
    exec co in mod.__dict__
  File "pyinstall\build\pyi.win32\lesson18\outPYZ1.pyz/OpenGL.arrays.vbo", line
430, in <module>
AttributeError: 'module' object has no attribute 'GL_READ_WRITE'
Press any key to continue . . .

This happens with all programs(including my own) that use pyOpenGL, the error is the same.

Are there any additional tricks(imports, etc.) to make a working executable with pyInstaller(I know there are with py2exe, but I prefer pyInstaller)?

My python version is 2.7 pyOpenGL ver.: 3.0.2a5 pyinstaller ver.: 1.5.1

MakerDrone
  • 109
  • 3
  • 9

1 Answers1

3

I found out a solution to this particular issue!

It is about the PyOpenGL version. Pyinstaller works fine with PyOpenGL version 3.0.1b1

You can download it here: http://sourceforge.net/projects/pyopengl/files/PyOpenGL/ and compile it yourself. Dont forget to remove your old PyOpenGL version from site-packages folder! You can check for active version of PyOpenGL on your system executing following:

>>>import pkg_resources
>>>pkg_resources.get_distribution("PyOpenGL").version
>>>'3.0.1b1'
kosta5
  • 1,129
  • 3
  • 14
  • 36