Confusing, desparate MySQLdb problems...

Ned Deily nad at acm.org
Sun Jan 17 12:52:55 EST 2010


In article 
<94e8cfd8-d299-4c23-9e9e-d3f17d4c9b55 at e16g2000yqc.googlegroups.com>,
 stopchuckingstuff <stopchuckingstuff at me.com> wrote:
> I'm not using either mod_wsgi or mod_python, I just edited httpd.conf.
> 
> You're right about setuptools - imports in terminal, not in cgi.
> however, the path to it (/Library/Frameworks/Python.framework/Versions/
> 2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg)
> is present in both sys.paths - as i said, both sys.paths are
> identical.
> 
> And from printing the sys.paths, /Library/WebServer/.python-eggs
> doesn't appear, I think it just uses it as a temporary folder to unzip
> the python eggs into.

>From your original post:
> When trying to import the module, it gives me this error:
> 
> <type 'exceptions.ImportError'>: /Library/WebServer/.python-eggs/
> MySQL_python-1.2.3c1-py2.6-macosx-10.3-fat.egg-tmp/_mysql.so: no
> appropriate 64-bit architecture (see "man python" for running in 32-
> bit mode)

so it appears that the .python-eggs directory is on sys.path.  But I 
don't know where that directory is coming from in the first place.  
Something you manually created?

> 
> What I don't understand is if the path is there, why doesn't it find
> the module?

Perhaps it is just a permissions problem since Apache is probably 
running under a different user name.  Check the owner/group and 
permissions of the various module directories and files. Make sure the 
directories and .so files have at least r-x and the python files at 
least r-- across the board.

-- 
 Ned Deily,
 nad at acm.org




More information about the Python-list mailing list