Permission denied when launch python script via bash

后端 未结 9 1165
予麋鹿
予麋鹿 2020-12-25 14:50
# ./scripts/replace-md5sums.py
bash: ./scripts/replace-md5sums.py: Permission denied

replace-md5sums.py has chmod 600

         


        
相关标签:
9条回答
  • 2020-12-25 15:01

    Mount your Windows partition with "exec" option - on some distros it's "noexec" by default.

    0 讨论(0)
  • 2020-12-25 15:09

    Try this

    python ./scripts/replace-md5sums.py
    
    0 讨论(0)
  • 2020-12-25 15:10

    Check for id. It may have root permissions.

    So type su and then execute the script as ./scripts/replace-md5sums.py.

    It works.

    0 讨论(0)
  • 2020-12-25 15:13

    Did you include

    #!/usr/bin/python
    

    as your first line?

    0 讨论(0)
  • 2020-12-25 15:14

    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.

    0 讨论(0)
  • 2020-12-25 15:16

    Do “chmod +x script”

    Now try executing

    0 讨论(0)
提交回复
热议问题