hello there.
in order to gain experience I started a small python project. it is an more or less simple, collaborative address book (Snow Leo and Python 2.6.1).
the final step is to create a standalone programm.
to create the address book I used PyQt4 and MySQLdb. since py2app chokes heavily on MySQLdb, I tried pyinstaller.
File "<string>", line 60, in <module>
File "PyInstaller/loader/iu.py", line 449, in importHook
File "PyInstaller/loader/iu.py", line 539, in doimport
File "Friver/build/pyi.darwin/Friver/outPYZ1.pyz/gui", line 6, in <module>
File "PyInstaller/loader/iu.py", line 449, in importHook
File "PyInstaller/loader/iu.py", line 539, in doimport
File "Friver/build/pyi.darwin/Friver/outPYZ1.pyz/handler", line 3, in <module>
File "PyInstaller/loader/iu.py", line 449, in importHook
File "PyInstaller/loader/iu.py", line 539, in doimport
File "build/bdist.macosx-10.6-universal/egg/MySQLdb/__init__.py", line 19, in <module>
File "PyInstaller/loader/iu.py", line 449, in importHook
File "PyInstaller/loader/iu.py", line 539, in doimport
File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 3, in __bootstrap__
File "PyInstaller/loader/iu.py", line 468, in importHook
ImportError: No module named pkg_resources
why does pyinstaller not add pkg_resources.py?
my app.spec:
# -*- mode: python -*-
a = Analysis([os.path.join(HOMEPATH,'support','_mountzlib.py'), os.path.join(CONFIGDIR,'support','useUnicode.py'), 'src/Friver.py'],
pathex=['/Volumes/Home/davo/Desktop/trunk'],
hookspath=None)
pyz = PYZ(a.pure)
exe = EXE( pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name=os.path.join('dist', 'Friver'),
debug=False,
strip=None,
upx=True,
console=True )
import sys
if sys.platform.startswith("darwin"):
app = BUNDLE(exe,
appname='Friver',
version=1)
I countered every obsticle, came so far...I just don't want to give up now and recode using QtSql.
thank you in advance :)
just out of curiosity, is there another workaround for py2app and MySQLdb other than unziped *.egg-file? because this one isn't working (importerror _mysql). adding _mysql to the apps site-packages by hand isn't working ether. it results in an pkg_resources error:
[0x0-0x1d11d1].org.pythonmac.unspecified.Friver[4527] File "MySQLdb/__init__.pyc", line 19, in <module>
[0x0-0x1d11d1].org.pythonmac.unspecified.Friver[4527] File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in <module>
[0x0-0x1d11d1].org.pythonmac.unspecified.Friver[4527] File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 4, in __bootstrap__
[0x0-0x1d11d1].org.pythonmac.unspecified.Friver[4527] File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 835, in resource_filename
[0x0-0x1d11d1].org.pythonmac.unspecified.Friver[4527] self, resource_name
[0x0-0x1d11d1].org.pythonmac.unspecified.Friver[4527] File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 1297, in get_resource_filename
[0x0-0x1d11d1].org.pythonmac.unspecified.Friver[4527] "resource_filename() only supported for .egg, not .zip"
[0x0-0x1d11d1].org.pythonmac.unspecified.Friver[4527] NotImplementedError: resource_filename() only supported for .egg, not .zip
maybe these 2 problems are somehow linked...