I'm preparing to upgrade a web app from Python 2.7 to 3.7. I ran into the following problem:
Entering /usr/bin/python in Terminal is working:
Python 2.7.10 (default, Feb 22 2019, 21:55:15)
Entering /usr/local/bin/python is also working:
Python 3.7.4 (v3.7.4:e09359112e, Jul 8 2019 14:54:52)
Using #!/usr/bin/python in a file test.py shows this in a browser:
2.7.10 (default, Feb 22 2019, 21:55:15)
So Python 2.7 is working. Now inserting '/local' into #!/usr/bin/python in the above mentioned test.py file leads to:
500 Internal Server Error
Why is that? I'm clueless, since the path /usr/local/bin/python works in Terminal.
test.py is a simple file which looks like that:
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
print "Content-Type: text/plain;charset=utf-8"
print
import sys
print(sys.version)
And .htaccess looks like this:
Options +ExecCGI
AddHandler cgi-script .py