<html><body bgcolor="#FFFFFF"><div>
<font face="Courier New, Courier, monospace"><small><big>To the powers
that be,<br>
<br>
I am running Apache 2 on Mac OSX 10.6.2.<br>
<br>
I have, after many hours, managed to install MySQLdb, however I'm not
sure if I installed it correctly as I had to fudge it a little.<br>
<br>
I can import and use the module fine in IDLE or in python from Terminal
(which would suggest it installed correctly), however when I try and
import the module in a cgi script, I get the following error out of
cgitb:<br>
<br>
<type 'exceptions.ImportError'>: No module named MySQLdb <br>
args = ('No module named MySQLdb',) <br>
message = 'No module named MySQLdb'<br>
<br>
MySQLdb installed inside a .egg file in
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages,
so I appended this to sys.path, and got a new error:<br>
"<br>
</big></small></font>
<blockquote><font face="Courier New, Courier, monospace"><small><big>Traceback
(most recent call last):</big></small><br>
<small><big> File "/Users/Sam/Sites/Spoonful/cgi-bin/view.py", line
19, in <;module>;</big></small><br>
<small><big> import MySQLdb</big></small><br>
<small><big> File
"build/bdist.macosx-10.3-fat/egg/MySQLdb/__init__.py", line 19, in
<;module>;</big></small><br>
<small><big> File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line
7, in <;module>;</big></small><br>
<small><big> File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line
4, in __bootstrap__</big></small><br>
<small><big> File
"/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py",
line 835, in resource_filename</big></small><br>
<small><big> self, resource_name</big></small><br>
<small><big> File
"/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py",
line 1304, in get_resource_filename</big></small><br>
<small><big> self._extract_resource(manager,
self._eager_to_zip(name))</big></small><br>
<small><big> File
"/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py",
line 1326, in _extract_resource</big></small><br>
<small><big> self.egg_name, self._parts(zip_path)</big></small><br>
<small><big> File
"/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py",
line 915, in get_cache_path</big></small><br>
<small><big> self.extraction_error()</big></small><br>
<small><big> File
"/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py",
line 881, in extraction_error</big></small><br>
<small><big> raise err</big></small><br>
<small><big>ExtractionError: Can't extract file(s) to egg cache</big></small><br>
<small><big> </big></small><br>
<small><big>The following error occurred while trying to extract
file(s) to the Python egg</big></small><br>
<small><big>cache:</big></small><br>
<small><big> </big></small><br>
<small><big> [Errno 13] Permission denied:
'/Library/WebServer/.python-eggs'</big></small><br>
<small><big> </big></small><br>
<small><big>The Python egg cache directory is currently set to:</big></small><br>
<small><big> </big></small><br>
<small><big> /Library/WebServer/.python-eggs</big></small><br>
<small><big> </big></small><br>
<small><big>Perhaps your account does not have write access to this
directory? You can</big></small><br>
<small><big>change the cache directory by setting the
PYTHON_EGG_CACHE environment</big></small><br>
<small><big>variable to point to an accessible directory.<br>
</big></small></font></blockquote>
<font face="Courier New, Courier, monospace">"<br>
<br>
I have no idea what to from there?!<br>
<br>
Apologies for the long question, but I've read many in which people
complained about not enough detail, so...<br>
Thanks very much, and I hope someone can help!<br>
<br>
Sam<br>
</font>
</div><div></div></body></html>