问题
I'm trying to create a GUI Python app using Py2App, but am having trouble running the setup script py2applet.
I've installed py2app via pip
$ sudo pip install py2app #this works ok
Then, I try to build the setup script:
$ py2applet --make-setup gui.py #this fails w/ no command found
What am I doing wrong?
回答1:
Try refreshing your shells' memory or try to call the app with full path just to see if that works. E.g. /usr/bin/py2applet
You can use
sudo find / -name "py2applet" -type f
To find the location if you don't know.
Eg bash would have the hash -r command to refresh itself. http://ss64.com/bash/hash.html
回答2:
Find the executable:
sudo find / -name "py2applet" -type f
Then add its parent directory to your PATH environment variable:
export PATH=$PATH:YOUR_PATH_HERE
回答3:
Btw in normal operation it should be in /usr/local/bin/
-rwxr-xr-x 1 admin admin 296 21 Apr 2015 /usr/local/bin/py2applet
回答4:
This worked for me on Mac OS X:
$ sudo pip install py2app
After installing py2app using pip:
$ python /Users/user/site-packages/py2app/script_py2applet.py --make-setup MyApplication.py
This works as well as using the py2applet command. If the py2app folder was installed elsewhere, be sure to include the full directory.
来源:https://stackoverflow.com/questions/11064657/py2applet-command-not-found