(Jun-10-2019, 10:14 AM)Gribouillis Wrote:Quote:it looks to be on the path (in console at least)The question is whether it is also on the path when it runs in apache2. What's the result in that case?
Hi, Thanks
I think it must be missing from the apache2 path somehow…
Apache2 Error Log:
//With
import sys
raise RuntimeError(sys.path)
//
[Tue Jun 11 18:10:41.932500 2019] [cgi:error] [pid 7222] [client ::1:61557] AH01215: File "/Users/mapps/Sites/test.py", line 19, in <module>: /Users/mapps/Sites/test.py
[Tue Jun 11 18:10:41.932539 2019] [cgi:error] [pid 7222] [client ::1:61557] AH01215: raise RuntimeError(sys.path): /Users/mapps/Sites/test.py
[Tue Jun 11 18:10:41.933277 2019] [cgi:error] [pid 7222] [client ::1:61557]
AH01215: RuntimeError: ['/Users/mapps/Sites',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
'/Library/Python/2.7/site-packages',
'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python',
'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC']:
/Users/mapps/Sites/test.py
[Tue Jun 11 18:10:41.936100 2019] [cgi:error] [pid 7222] [client ::1:61557] End of script output before headers: test.py
//adding before the sys path command terminates early
import pymysql
print(pymysql)
//
[Tue Jun 11 19:09:28.212921 2019] [cgi:error] [pid 7225] [client ::1:61683] AH01215: Traceback (most recent call last):: /Users/mapps/Sites/test.py
[Tue Jun 11 19:09:28.213230 2019] [cgi:error] [pid 7225] [client ::1:61683] AH01215: File "/Users/mapps/Sites/test.py", line 12, in <module>: /Users/mapps/Sites/test.py
[Tue Jun 11 19:09:28.213257 2019] [cgi:error] [pid 7225] [client ::1:61683] AH01215: import pymysql: /Users/mapps/Sites/test.py
[Tue Jun 11 19:09:28.213297 2019] [cgi:error] [pid 7225] [client ::1:61683] AH01215: ImportError: No module named pymysql: /Users/mapps/Sites/test.py
[Tue Jun 11 19:09:28.215094 2019] [cgi:error] [pid 7225] [client ::1:61683] End of script output before headers: test.py
(Jun-10-2019, 10:14 AM)Gribouillis Wrote: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
In addition to this there is pymysql in the path but not as far as I can tell where it is expecting to see it: - I may have to copy it into the path somehow or add it in via the script..?
C-and-Ty:site-packages mapps$ pwd
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
C-and-Ty:site-packages mapps$ ls -d -- */
Django-1.11.20.dist-info/ mysqlx/
PyMySQL-0.9.3.dist-info/ pip-19.1.1.dist-info/
certifi-2019.3.9.dist-info/ pip/
certifi/ pkg_resources/
django/ protobuf-3.8.0.dist-info/
google/ pymysql/
mysql-vendor/ pytz-2018.9.dist-info/
mysql/ pytz/
mysql_connector-2.2.9-py2.7.egg-info/ setuptools-40.6.2.dist-info/
mysql_connector_python-8.0.16.dist-info/ setuptools/
mysql_connector_python_dd-2.0.2-py2.7.egg-info/ six-1.12.0.dist-info/
mysql_connector_repackaged-0.3.1-py2.7.egg-info/