Permission denied when launch python script via ba

2020-02-23 08:28发布

# ./scripts/replace-md5sums.py
bash: ./scripts/replace-md5sums.py: Permission denied

replace-md5sums.py has chmod 600

# ls -l ./scripts/replace-md5sums.py
-rw------- 1 ubuntu ubuntu 661 2011-04-27 16:30 ./scripts/replace-md5sums.py

10条回答
forever°为你锁心
2楼-- · 2020-02-23 09:14

chmod 755 fileName

#!/usr/bin/python2.7 -tt
查看更多
forever°为你锁心
3楼-- · 2020-02-23 09:17

I'm a Ubuntu user and I had the same issue, when I was trying to run python script through a bash script while files were located in a NTFS partition (even with su didn't work) then I've moved it home (ext4) then it worked.

查看更多
一夜七次
4楼-- · 2020-02-23 09:18

Did you include

#!/usr/bin/python

as your first line?

查看更多
叼着烟拽天下
5楼-- · 2020-02-23 09:20

I solved my problem. it's just the version of python which the interpreter reads off the first line. removing to version numbers did it for me, i.e.

#!/usr/bin/python2.7 --> #!/usr/bin/python
查看更多
登录 后发表回答