Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

module not found (conditional imports) with py2app

Tags:

python

py2app

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

like image 588
jmercier Avatar asked Nov 28 '25 05:11

jmercier


1 Answers

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.

like image 151
André Aulich Avatar answered Nov 29 '25 21:11

André Aulich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!