The problem is with your python installation. Probably your /usr/bin/python
either does not exist at all or it is a dead symbolic link pointing to non-existing python.
So first solution is to check if /usr/bin/python
exists. If so check if it’s not dead link and if it is, fix the link to point to existing python intepretter:
cd /usr/bin
sudo ln -fs <full_path_to_existing_python_binary> python
If you can’t or don’t want to change /usr/bin/python
but you have python installed and its location is recognized by the system (i.e. calling python
from shell works) you can try changing your script as a workaround:
#! /usr/bin/env python
print("worked")
This way your script will use python as an interpreter regardless of the real python location as long as it is in your PATH.