Reputation: 11
Please actually read my post instead of just the title. This is a larger system issue, not a typo or a file permissions issue.
I am attempting to run my script without having to type in 'python3' before every test run, and potentially to make scheduling a cron job easier. No matter what I've tried, I always get the error -bash: ./main.py: Permission denied
. I've tried the following:
/usr/bin/
with or without a space after '#!'/usr/bin/env [python version]
.chmod 777
on every python file in /usr/bin
chmod 777
on every file and folder in my script directory.root
and wheel
groups.I'm at a loss here. Every other post I've seen about this is just saying to do chmod +x
, which doesn't apply in my case.
Edit 1: I've now tried reinstalling both bash and python, as well as running dos2unix
on all of my script files to make sure the EOL characters weren't the problem. No luck.
Upvotes: -1
Views: 74
Reputation: 11
The problem ended up being that the directory the scripts were in had the noexec
flag set.
Upvotes: 0