module not found (conditional imports) with py2app

别来无恙 提交于 2019-12-25 03:02:46

问题


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.



来源:https://stackoverflow.com/questions/30820906/module-not-found-conditional-imports-with-py2app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!