I am making an app in python which needs to store keys. I used keyring module to store keys. I am using python-2.7 and osx 10.8.5 with keyring 3.2( easy_install keyring). Code is running fine on eclipse, but when I converted code into app using py2app, it shows error of MYAPP Error open console Terminate
import keyring
keyring.set_password("title","section","keys")
res= keyring.get_password("title","section")
I included terminal response scrap when typed "python setup.py py2app" while making dist through py2app
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/__init__.py to keyring/__init__.pyc
creating /Users/fis/Desktop/build/bdist.macosx-10.8-intel/python2.7-semi_standalone/app/collect/keyring
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/backend.py to keyring/backend.pyc
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/core.py to keyring/core.pyc
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/errors.py to keyring/errors.pyc
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/getpassbackend.py to keyring/getpassbackend.pyc
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/py27compat.py to keyring/py27compat.pyc
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/util/__init__.py to keyring/util/__init__.pyc
creating /Users/fis/Desktop/build/bdist.macosx-10.8-intel/python2.7-semi_standalone/app/collect/keyring/util
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/util/platform_.py to keyring/util/platform_.pyc
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/util/properties.py to keyring/util/properties.pyc
byte-compiling /Library/Python/2.7/site-packages/pathtools-0.1.2-py2.7.egg/pathtools/__init__.pyc to pathtools/__init__.pyc
creating /Users/fis/Desktop/build/bdist.macosx-10.8-intel/python2.7-semi_standalone/app/collect/pathtools
I don't have the possibility to try this out locally, here's my best guess:
Try importing all the bits you'll actually need in the app, including exceptions that don't occur during "normal" execution
You may also require some other package at runtime, to check that, do the following:
You see how many modules were brought in as a result of
import keyring, but also some more modules got brought in as a result ofkeyring.set_password(...).Now, most of this should be automatic with
py2app, but some runtime dependencies can be missed.The reason behind this is that
py2appdoes something tricky when it decides which modules to include. Pretend thatkeyring.set_password()doesn't actually run at this phase. In fact if it did andset_passwordmust have side effects, would you expectpy2appto package a plain or modified module?