Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

running python executable in linux

Tags:

python

ubuntu

I've found a few other people asking this question, but the answers for their problem are not helping me. I trying to learn python and trying to make a file executable.

The practice script runs when I type python ./userPrompt.py. But when I try to run it as an executable (just ./userPrompt.py).

I've successful change it chmod +x And here's what i have in the top line of the file:

    #! /user/bin/env python 

and here's the error I get

   bash: ./userPrompt.py: /user/bin/env: bad interpreter: No such file or directory

But the thing is if I go to /user/bin I can find env. So it definitely exists. Why can't Ubuntu find it??

I appreciate any help people can give me on this.

like image 674
Jeff Avatar asked Feb 07 '26 05:02

Jeff


1 Answers

The path is /usr, not /user.

like image 141
Mark Reed Avatar answered Feb 09 '26 18:02

Mark Reed



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!