[mod_python] Threads...

Vio vmilitaru at sympatico.ca
Tue May 13 11:43:51 EST 2003


Gregory (Grisha) Trubetskoy wrote:

>IIRC this has to do with -lutil missing from the compile command on some
>systems - try hacking the Makefile and adding it manually.
>  
>

Thanks for the tip. That seems to do it. For the record, I simply edited
mod_python-2.7.8/src/Makefile as:
...
LIBS=-lm  /q/Python-2.2.2/libpython2.2.a  -lutil


Now apache starts ok, and I can access 'mysql' from python prompt just 
as nicely from the python prompt.
 >>> import MySQLdb

But this puzzles me: importing MySQLdb from within PythonHandler still 
gives me the old 'threads' error:

-------------------------
Mod_python error: "PythonHandler test"

Traceback (most recent call last):

  File "/usr/local/lib/python2.2/site-packages/mod_python/apache.py", 
line 193, in Dispatch
    result = object(req)

  File "/usr/local/apache/htdocs/server/test.py", line 20, in handler
    import MySQLdb

  File "/usr/local/lib/python2.2/site-packages/MySQLdb/__init__.py", 
line 27, in ?
    import _mysql

ImportError: /usr/local/lib/python2.2/site-packages/_mysql.so: undefined 
symbol: pthread_key_create
--------------------------


This is puzzling because I recompiled/reinstalled both mod_python and 
MySQLdb, manually zapped _mysql.so (just to be sure), obviously 
restarted apache, and still get this pthreads error. Seems to me like 
mod_python and the python interactive interpreter are not using the same 
"_mysql.so" somehow. Is mod_python cache somewhere ?
Any ideas?

Vio




More information about the Mod_python mailing list