At your terminal type:
make sure that this path in the shebang at in the 1st line of your .py file. On my system it is
then 1st try:
in any terminal
check that the PATH actually stuck by checking:
should have path to your script in there now.
you should now be able to launch you script form anywhere.
the PATH will reset once you close terminal though so you should get pay do get it added permanently to your PATH.
good solution is to have the following bit of code in you .bash_profile:
if [ -f ~/.bashrc ]; then
see writeup e.g. http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html this will ensure that .bashrc is loaded every time the terminal is launched as well as when you launch a subshell. Put the export
line somewhere in your .bashrc file. quit and restart terminal. That should sort everything out