module not found (conditional imports) with py2app

4.9k views Asked by At

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

There are 1 answers

0
André Aulich On BEST ANSWER

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.