[Hidden-tech] Python 3.7 on Mac

David Greenberg david.greenberg3 at gmail.com
Sun Mar 31 18:49:04 UTC 2019


Hi All,
I've got it installed and running, but I can't figure out how to make it
the default as far as Apache is concerned. I have an extremely simple
script:

#!/usr/bin/env python
print ("Content-Type: plain;charset=utf-8\r\n")
print()

print("Hello World!")

which runs as a Python 2.7 script as expected after enabling
LoadModule cgi_module libexec/apache2/mod_cgi.so
in https.conf, but if I try to change 'python' to 'python3' I get a 500
error and the Apache error log says:

[Sun Mar 31 13:34:38.253331 2019] [cgi:error] [pid 26370] [client
::1:52412] End of script output before headers: testLocalHost.py

I tried adding the two lines below in httpd.conf but that just resulted in
the same 500 error.

LoadModule wsgi_module
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mod_wsgi/server/
mod_wsgi-py37.cpython-37m-darwin.so
WSGIPythonHome /Library/Frameworks/Python.framework/Versions/3.7

I was on the verge of trying this:

ln -s /Library/Frameworks/Python.framework/Versions/3.7 /usr/bin/python3

but since I really don't know what I'm doing, I got cold feet and decided
to ask for help. Thanks.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hidden-tech.net/pipermail/hidden-discuss/attachments/20190331/a71ffd7a/attachment.html>


Google

More information about the Hidden-discuss mailing list