LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I add python to the PATH... (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-add-python-to-the-path-713305/)

trist007 03-21-2009 02:09 AM

How do I add python to the PATH...
 
Python command is in /usr/bin and I have /usr/bin in my $PATH. I want to be able to run

./program.py

instead of having to do

python program.py

What do I need to do?

vindoan 03-21-2009 02:12 AM

Do you have the command directive on the first line of the python script?

#!/usr/bin/env python

Have you set the execute bit on the file?

chmod +x file.py

Cheers

trist007 03-21-2009 09:11 AM

Yes I have

#!/usr/bin/python

Yes I have the execute bit on

The program runs if I do

sudo python ./program.py

But I want to be able to do

sudo ./program.py


All times are GMT -5. The time now is 07:38 PM.