Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission denied when i try to execute a python script from bash? [duplicate]

I downloaded a python script from the web and when i try to execute it from bash it throws a exception:

User:python_script user$ ./python_script.py -n some_parameter -b

The output is the following:

-bash: ./python_script.py: Permission denied

the file all ready has: #!/usr/bin/python at the top of the script. How can i solve this?

like image 809
tumbleweed Avatar asked Oct 28 '14 22:10

tumbleweed


1 Answers

You need to add execute permissions like so:

chmod u+x python_script.py

This assumes that the script is owned by you. If it isn't, you might need to change the group/other execute permissions or chown the file as appropriate.

like image 96
NPE Avatar answered Oct 04 '22 02:10

NPE