PDA

View Full Version : Problem with the "shebang" in ubuntu



alex13gamerz
February 15th, 2016, 10:25 AM
Hello, all.
I'm programming in python 2.7, and I happened to have a problem in executing my programms/scripts.
I write #!/usr/bin/env python, but the system seems to not recognize this line because executes my python script as a bash script. I tryed to write #!/usr/bin/python directly but does not work either. What can I do to solve this? Thank you.

steeldriver
February 15th, 2016, 11:40 AM
Hello and welcome to the forums

How exactly are you trying to run the script?

alex13gamerz
February 15th, 2016, 03:39 PM
I'm trying to run it like a normal executable: ./script.py, I gave it execution permission too, but doesn't work at all.

Habitual
February 15th, 2016, 03:48 PM
What the script written on a Linux Machine?
Can you post the script?

spjackson
February 15th, 2016, 03:48 PM
Please post terminal output from trying to run the script.
Post the script if possible.
Post the output of


od -c ./script.py | head

Vaphell
February 16th, 2016, 09:55 AM
are you sure you put it in the very first line? If not, then your shebang is nothing but a comment (#)