I'm testing out an app that I've made which, amongst other things, loads a couple of .png images when opened. The images are displayed correctly on my Mac (10.7.5) and my mother's (10.8.5); however when my sister opens it on hers (10.9.5) the images don't load. All other functionality is otherwise intact. I should note that on my Mac and my mother's, I installed Python 3.4 and many of the packages that the app uses, including the PIL package, whereas my sister has none of these. The app was build using the command:
python3.4 setup.py py2app
Images are imported in the code with:
image = ImageTk.PhotoImage(file = "images/pic.png")
Setup file for py2app is as follows:
from setuptools import setup
APP = ['myapp.py']
DATA_FILES = [('', ['images'])]
OPTIONS = {'iconfile': 'myapp.icns', 'packages': ['PIL']}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
My guess is that it's an issue with PIL, it just doesn't seem to want to play nicely with py2app. The reason I think it's PIL is because after running the command to build my app I get the following error message in Terminal.
Modules not found (conditional imports):
* Image (/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/py2app/recipes/PIL/prescript.py)
I'd be very grateful for any suggestions or direction.
from PIL import Image
. Your sister's computer most likely has a more recent version of python so this is hence the way to install it, any other way would throw an error – Pym