[Pythonmac-SIG] py2app import errors

Oliver Goodman oag at optusnet.com.au
Wed Aug 19 05:03:33 CEST 2009


Hi,
I'm having problems getting py2app to work for me.

The program (minimal test case):

   # test.py
   from Crypto.Cipher import DES3

   if __name__ == '__main__':
     pass

Runs fine on the command line.

Then I do:

mymble:bob oag$ rm -rf build/ dist/
mymble:bob oag$ py2applet --make-setup test.py
Existing setup.py detected, replace? [Y/n] y
Wrote setup.py
mymble:bob oag$ python setup.py py2app
running py2app
creating /Users/oag/Projects/python/bob/build
creating /Users/oag/Projects/python/bob/build/bdist.macosx-10.5-i386
creating /Users/oag/Projects/python/bob/build/bdist.macosx-10.5-i386/ 
python2.5-semi_standalone
creating /Users/oag/Projects/python/bob/build/bdist.macosx-10.5-i386/ 
python2.5-semi_standalone/app
creating /Users/oag/Projects/python/bob/build/bdist.macosx-10.5-i386/ 
python2.5-semi_standalone/app/collect
creating /Users/oag/Projects/python/bob/build/bdist.macosx-10.5-i386/ 
python2.5-semi_standalone/app/temp
creating /Users/oag/Projects/python/bob/dist
creating build/bdist.macosx-10.5-i386/python2.5-semi_standalone/app/ 
lib-dynload
creating build/bdist.macosx-10.5-i386/python2.5-semi_standalone/app/ 
Frameworks
*** filtering dependencies ***
199 total
191 filtered
0 orphaned
8 remaining
*** create binaries ***
creating /Users/oag/Projects/python/bob/build/bdist.macosx-10.5-i386/ 
python2.5-semi_standalone/app/temp/Crypto
creating /Users/oag/Projects/python/bob/build/bdist.macosx-10.5-i386/ 
python2.5-semi_standalone/app/temp/Crypto/Cipher
creating python loader for extension 'Crypto.Cipher.DES3'
*** byte compile python files ***
byte-compiling /Library/Python/2.5/site-packages/Crypto/Cipher/ 
__init__.py to Crypto/Cipher/__init__.pyc
creating /Users/oag/Projects/python/bob/build/bdist.macosx-10.5-i386/ 
python2.5-semi_standalone/app/collect/Crypto
creating /Users/oag/Projects/python/bob/build/bdist.macosx-10.5-i386/ 
python2.5-semi_standalone/app/collect/Crypto/Cipher
byte-compiling /Library/Python/2.5/site-packages/Crypto/__init__.py to  
Crypto/__init__.pyc
byte-compiling /Library/Python/2.5/site-packages/py2app-0.3.6- 
py2.5.egg/py2app/bootstrap/argv_emulation.py to argv_emulation.pyc
byte-compiling /Library/Python/2.5/site-packages/py2app-0.3.6- 
py2.5.egg/py2app/bootstrap/boot_app.py to boot_app.pyc
byte-compiling /Library/Python/2.5/site-packages/py2app-0.3.6- 
py2.5.egg/py2app/bootstrap/chdir_resource.py to chdir_resource.pyc
byte-compiling /Library/Python/2.5/site-packages/py2app-0.3.6- 
py2.5.egg/py2app/bootstrap/disable_linecache.py to disable_linecache.pyc
byte-compiling /Users/oag/Projects/python/bob/test.py to test.pyc
byte-compiling /Users/oag/Projects/python/bob/build/bdist.macosx-10.5- 
i386/python2.5-semi_standalone/app/temp/Crypto/Cipher/DES3.py to  
Crypto/Cipher/DES3.pyc
*** creating application bundle: test ***
copying /System/Library/Frameworks/Python.framework/Versions/2.5/ 
Resources/Python.app/Contents/Resources/PythonApplet.icns -> /Users/ 
oag/Projects/python/bob/dist/test.app/Contents/Resources
copying test.py -> /Users/oag/Projects/python/bob/dist/test.app/ 
Contents/Resources
creating /Users/oag/Projects/python/bob/dist/test.app/Contents/ 
Resources/lib
creating /Users/oag/Projects/python/bob/dist/test.app/Contents/ 
Resources/lib/python2.5
copying build/bdist.macosx-10.5-i386/python2.5-semi_standalone/app/ 
site-packages.zip -> /Users/oag/Projects/python/bob/dist/test.app/ 
Contents/Resources/lib/python2.5
creating /Users/oag/Projects/python/bob/dist/test.app/Contents/ 
Resources/lib/python2.5/lib-dynload
creating /Users/oag/Projects/python/bob/dist/test.app/Contents/ 
Frameworks
creating /Users/oag/Projects/python/bob/dist/test.app/Contents/ 
Resources/lib/python2.5/lib-dynload/Crypto
creating /Users/oag/Projects/python/bob/dist/test.app/Contents/ 
Resources/lib/python2.5/lib-dynload/Crypto/Cipher
copying /Library/Python/2.5/site-packages/Crypto/Cipher/DES3.so -> / 
Users/oag/Projects/python/bob/dist/test.app/Contents/Resources/lib/ 
python2.5/lib-dynload/Crypto/Cipher
stripping DES3.so
stripping test
stripping saved 71852 bytes (138156 / 210008)
mymble:bob oag$ open dist/test.app/

Running it gives me:

19/08/09 12:54:17 PM  
[0x0-0x3d13d1].org.pythonmac.unspecified.test[11989] ImportError: '/ 
System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ 
lib-dynload/Crypto/Cipher/DES3.so' not found

My setup is standard and I haven't done anything non-obvious.
   computer: Mac OS X 10.5.8 Intel Core 2 Duo
   python: Python 2.5.1 (r251:54863, Feb  9 2009, 18:49:36)
     [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
   py2app version: 0.3.6
   pycrypto: 2.0.1 for py2.5 (egg in site-packages)

I also tried adding the --site-packages flag and -i Crypto.Cipher.DES3  
to no avail.

-Oliver






More information about the Pythonmac-SIG mailing list