sudo:python command not found

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Guneet007
    New Member
    • Jul 2017
    • 2

    sudo:python command not found

    i am trying to run a file name Filename.py on puTTY software which i also created on puTTY using sudo nano Filename.py
    on running the code using "sudo python Filename.py"
    errors comes up as "sudo: python: command not found"

    please help
  • dwblas
    Recognized Expert Contributor
    • May 2008
    • 626

    #2
    Does the user have the right to run sudo (and why do you have to run the program as root)? Also, try using the /complete/path/to/the/file/Filename.py, or ./Filename.py if the shell is in the correct directory (note the dot+slash). And use a shebang line and make the file executable, instead of calling python -- see "Miscellane ous" at https://docs.python.org/2/using/unix.html

    Comment

    • Guneet007
      New Member
      • Jul 2017
      • 2

      #3
      Worked
      Thank you....👍

      Comment

      Working...