Hi Lorenzo,
Lorenzo Mancini wrote:
>
> If aren't tied to py2exe for some reason, I suggest you to try
> PyInstaller (http://pyinstaller.python-hosting.com): some time ago I
> contributed the support for PyOpenGL >=3.0.0b6, which now should work
> with no manual intervention needed.
>
> PyOpenGL 2.x is also supported.
>
> Remember to checkout PyInstaller trunk:
>
> svn co http://svn.pyinstaller.python-hosting.com/trunk pyinstaller
>
> because the latest stable version (1.3) is really outdated.
That sounds pretty cool! I just can't make it work... :(
I have a fairly simple app using PyQT and PyOpenGL. I follow the
instructions on the website, but I'm running into problems with
importing _ctypes in the final executable.
My spec file:
# -*- mode: python -*-
a = Analysis([os.path.join(HOMEPATH,'support\\_mountzlib.py'),
os.path.join(HOMEPATH,'support\\useUnicode.py'),
'd:\\Workspace\\Grid3D\\src\\pyqt\\grid3d.py'],
pathex=['D:\\CMPS415_Stuff\\Installer_trunk'])
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts + [('v','','OPTION')],
exclude_binaries=1,
name=os.path.join('build\pyi.win32\grid3d', 'grid3d.exe'),
debug=True,
strip=False,
upx=False,
console=True )
coll = COLLECT( exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=False,
name=os.path.join('dist', 'grid3d'))
Build output:
D:\CMPS415_Stuff\Installer_trunk>python.exe Build.py Grid3D\grid3d.spec
Build.py:29: DeprecationWarning: the md5 module is deprecated; use
hashlib instead
import md5
checking Analysis
checking PYZ
building because outPYZ1.toc is bad
building PYZ outPYZ1.toc
checking PKG
building because Grid3D\build\pyi.win32\grid3d\outPYZ1.pyz changed
building PKG outPKG3.pkg
checking EXE
building because debug changed
building EXE from outEXE2.toc
Appending archive to EXE Grid3D\build\pyi.win32\grid3d\grid3d.exe
checking COLLECT
building outCOLLECT4.toc because
Grid3D\build\pyi.win32\grid3d\grid3d.exe is more recent
building COLLECT outCOLLECT4.toc
The warngrid3d.txt is a little long for this mail, I put it on drop.io
at http://drop.io/dlww0ve .
Running the program output:
D:\CMPS415_Stuff\Installer_trunk\Grid3D\build\pyi.win32\grid3d>grid3d.exe
Cannot open archive:
D:\CMPS415_Stuff\Installer_trunk\Grid3D\build\pyi.win32\grid3d\grid3d.pkg
Extracting binaries
python26.dll
Manipulating evironment
PYTHONPATH=D:/CMPS415_Stuff/Installer_trunk/Grid3D/build/pyi.win32/grid3d
v
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
importing modules from CArchive
import marshal # builtin
extracted iu
import imp # builtin
import nt # builtin
extracted struct
import _struct # builtin
extracted archive
Installing import hooks
outPYZ1.pyz
Running scripts
import zlib # builtin
import _codecs # builtin
import errno # builtin
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "D:\CMPS415_Stuff\Installer_trunk\iu.py", line 427, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "D:\CMPS415_Stuff\Installer_trunk\iu.py", line 512, in doimport
exec co in mod.__dict__
File "Grid3D\build\pyi.win32\grid3d\outPYZ1.pyz/OpenGL.GL", line 2,
in <module>
File "D:\CMPS415_Stuff\Installer_trunk\iu.py", line 427, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "D:\CMPS415_Stuff\Installer_trunk\iu.py", line 512, in doimport
exec co in mod.__dict__
File "Grid3D\build\pyi.win32\grid3d\outPYZ1.pyz/OpenGL.raw.GL", line
6, in <module>
File "D:\CMPS415_Stuff\Installer_trunk\iu.py", line 427, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "D:\CMPS415_Stuff\Installer_trunk\iu.py", line 512, in doimport
exec co in mod.__dict__
File
"Grid3D\build\pyi.win32\grid3d\outPYZ1.pyz/OpenGL.raw.GL.constants",
line 6, in <module>
File "D:\CMPS415_Stuff\Installer_trunk\iu.py", line 427, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "D:\CMPS415_Stuff\Installer_trunk\iu.py", line 512, in doimport
exec co in mod.__dict__
File "Grid3D\build\pyi.win32\grid3d\outPYZ1.pyz/ctypes", line 10, in
<module>
File "D:\CMPS415_Stuff\Installer_trunk\iu.py", line 446, in importHook
raise ImportError, "No module named %s" % fqname
ImportError: No module named _ctypes
RC: -1 from grid3d
OK.
This using python 2.6, PyOpenGL 3.0.0 and PyInstaller trunk.
Any ideas what could be going wrong?
Thanks
Dirk
|