问题
I have a software written in python with a graphical user interface written in PyQt. To create an executable of the software I ship with it a Python and a Qt precompiled version and the trick seems to work in windows and linux since I know How to create an istaller. The problem is to embed evrything into a mac .app To launch the software I use the following shel script
export DYLD_LIBRARY_PATH=`pwd`/lib:$DYLD_LIBRARY_PATH
export DYLD_FRAMEWORK_PATH=`pwd`/Resources
PYTHONPATH=$PYTHONPATH:. bin/python ProgramPy/Main.py
If I run this shell script from outside it works fine but when I try to embed everything into an app with platypus I get the following error.
dyld: Library not loaded: @executable_path/../.Python
Referenced from: /Users/luca/Desktop/TempScript.app/Contents/Resources/bin/python
Reason: image not found
./run.sh: line 3: 725 Trace/BPT trap PYTHONPATH=$PYTHONPATH:. bin/python ProgramPy/Main.py
Note that the file /Users/luca/Desktop/TempScript.app/Contents/Resources/bin/python
is the executable version of python and it is actually located into the Resources folder of the app. I don't understand why the system cannot find it...
Maybe I miss something in understanding how mac uses the pythonpath ...
Thanks
回答1:
I just use py2app.
来源:https://stackoverflow.com/questions/4206511/launch-python-into-a-mac-application