-->

module not found (conditional imports) with py2app

2019-09-05 01:43发布

问题:

I have a little problem with py2app when I build the app, I have this error

Modules not found (conditional imports):
 * Image (/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/py2app-0.9-py3.4.egg/py2app/recipes/PIL/prescript.py)
 * java (platform)
 * java.lang (platform)

I guess it is a path problem with my python 3, but I'm not sure TY for help

回答1:

I guess you build your app like this:

python3 setup.py myapp

and are using py2app 0.9?

If you are trying

python3 setup.py myapp -A

does this work? Using aliases only seems to work in most cases, but this doesn't help if you want to deploy your app to other machines.

Instead, explicitly tell py2app to include your packages:

python3 setup.py myapp --packages=PIL

This would properly include your PIL or Pillow module. Should work with the other modules, too.



标签: python py2app