bash: ./my-script.py: /usr/bin/env: bad interpreter: Permission denied
The partition your script lives on may be mounted with the "user" option set. "user" implies "noexec" (see the manpage for "mount"), which is going to keep you from running executables. And while running a binary executable from this kind of partition fails more clearly, trying to run a script with a shebang gives you this more confusing error message.
To fix! Add "exec" after your "user" flag in /etc/fstab. (again, see "man mount").
5 comments:
very interesting solution that help me a lot. Never more i'll get this error again!
Great! Thanks for the comment :)
I figured that if I ran into the problem, surely somebody else would have it...
Thanks, it was exactly what I needed
Just in case anyone is wondering about the details the command to remount with exec permissions is:
mount -o remount,exec /dev/sdaX
where /dev/sdaX is mounted with noexec
Goodd reading this post
Post a Comment