Unable to execute shebang scripts after chmod +x

I've been unable to run Python, Ruby, & Node scripts marked with a shebang.


Before preforming a a factory reset with the help from an Apple Genius, I was able to use chmod +x to make a script executable. Since the reset, the same scripts returns "permission denied". If I try to run the script with sudo, "unable to execute" is returned.


Any ideas of how to fix this? Based on my web searches, it may have to do with a noexec flag listed after using the mount command.


User uploaded file

MacBook Pro (15-inch, 2017), macOS High Sierra (10.13.6)

Posted on Aug 4, 2018 3:38 PM

Reply

Similar questions

4 replies

Aug 4, 2018 8:22 PM in response to mick-io

That #!/usr/local/bin<space>python3 is an incorrect invocation. As there is no python3 installed by Apple, you can use either of the following:


#!/usr/local/env python3

or

#!/usr/local/bin/python3


The latter would simply be a link into the Python3 framework that is likely installed in Library/Frameworks.


I believe that noexec option in the mounted filesystem will halt any attempt to execute code on it.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Unable to execute shebang scripts after chmod +x

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.