Problem

When running a Python script it fails with the following output:

: command not found

Cause

as it appears - this is a path issue. Python scripts have a tendency to have no shebang at the top and consequently your script may be being executed by your standard shell instead of python.

Resolution

  • Try running the script with python interpreter directly:
python script.py

Category:Programming