Binsky734
Binsky734

Reputation: 11

Python3 shebang -bash: ./main.py: Permission denied

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:

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

Answers (1)

Binsky734
Binsky734

Reputation: 11

The problem ended up being that the directory the scripts were in had the noexec flag set.

Upvotes: 0

Related Questions