Home > OS >  Ubuntu Unable to execute No such file or directory
Ubuntu Unable to execute No such file or directory

Time:12-13

Installed Ubuntu and get this error. Latest Python package installed

Command: sudo ./Task1.py

Error: sudo: unable to execute ./Task1.py: No such file or directory

Working Command:

  • sudo
  • chmod x Task1.py
  • gedit Task1.py

but sudo ./Task1.py not working can anyone help me

Thank you

CodePudding user response:

Several ways:

  1. use pwd to show dir address.
  2. use ls | grep py to see whether it is there.

CodePudding user response:

First run ls which will list the files/folders in your current path. If task.py is listed, doing python task.py should run the file.

  • Related