Python script fails with ": command not found"

From ben.goodacre.name/tech

Jump to: navigation, search

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

python script.py
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox