I have trouble with php calling a python script, or its calling the script but stops somewhere on the way when trying to import MySQLdb
now after adding, to my user .bash_profile, following this guide How do you fix a Trac installation that begins giving errors relating to PYTHON_EGG_CACHE?
export PYTHON_EGG_CACHE /var/www/html/path/cache
and to httpd.conf
AddHandler mod_python
SetEnv PYTHON_EGG_CACHE /var/www/html/path/cache
i still get this error message, the webserver still try to access /root/.python-eggs and i cant find my exported .python-eggs in my new folder
Array
(
[stdout] =>
[stderr] => Traceback (most recent call last):
File "/var/www/html/grndb/upscgenesearch/python/pythontest.py", line 4, in ?
import MySQLdb
File "build/bdist.linux-x86_64/egg/MySQLdb/__init__.py", line 19, in ?
File "build/bdist.linux-x86_64/egg/_mysql.py", line 7, in ?
File "build/bdist.linux-x86_64/egg/_mysql.py", line 4, in __bootstrap__
File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 799, in resource_filename
return get_provider(package_or_requirement).get_resource_filename(
File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 1229, in get_resource_filename
return self._extract_resource(manager, zip_path)
File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 1249, in _extract_resource
real_path = manager.get_cache_path(
File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 880, in get_cache_path
self.extraction_error()
File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 846, in extraction_error
raise err
pkg_resources.ExtractionError: Can't extract file(s) to egg cache
The following error occurred while trying to extract file(s) to the Python egg cache:
[Errno 13] Permission denied: '/root/.python-eggs'
The Python egg cache directory is currently set to:
/root/.python-eggs
Perhaps your account does not have write access to this directory? You can change the cache directory by setting the PYTHON_EGG_CACHE environment variable to point to an accessible directory.