I’m trying to use the '#! /usr/bin/python3'
on a centos7 but since I had to
install Python3 via:
Yum install centos-release-scl
Yum install rh-python36
scl enable rh-python36 bash
The Python3 isn’t in the /usr/bin/python3
I tried using:
#! /opt/rh/rh-python36
I get these errors when trying to run a python script
bash: ./pw.py: /opt/rh/rh-python36: bad interpreter: Permission denied
./pw.py: /opt/rh/rh-python36: bad interpreter: Permission denied
2
Answers
This means your folder permissions are not allowing you to use that interpreter. Please verify that
/opt/rh/rh-python36
has it’s permissions set so that you can read and execute there, otherwise it will give you a permission denied error.sudo chmod -R 755 /opt/rh/rh-python36/
Easy, but not elegant fix: Try downloading a local user version of Python and reference that local Python3 file
#! /local/path/python3
.