[Pythonmac-SIG] mod_python / lib compatibility question
jim at monkeybiz.stanford.edu
Sun Mar 20 22:26:24 CET 2005
A question from a new mod_python user:
When I run within an otherwise working apache2/mod_python, if my script
imports MySQLdb I get a dyld compability version error:
File "/Users/jim/Sites/WatchEvents.py", line 97, in ?
import MySQLdb, pickle
line 27, in ?
ImportError: Failure linking new module:
/opt/local/lib/libssl.0.9.7.dylib: dyld: /opt/local/apache2/bin/httpd
version mismatch for library: /opt/local/lib/libssl.0.9.7.dylib
(compatibility version of user: 0.9.7 greater than library's version:
Now, /opt/local/lib/libssl.0.9.7, like /opt/local/apache2/bin/httpd,
and the installed copy of _mysql.so report having "(compatibility
version 0.9.0, current version 0.9.7)". [Perhaps it matters that
/usr/local/lib/libssl.0.9.7 has "(compatibility version 0.9.7, current
version 0.9.7)", but I don't see where it's used] As I understand it
[from man ld] this sort of dyld error should only occur when the
program compatibility version is > the lib version -- yet the lib is
version 0.9.7, >= all the compatibility versions in play.
Can anyone see what I'm missing?
I should point out that MySQLdb was installed in the usual way using
setup.py, and I did redo this after fully updating the darwinports tree
and rebuilding apache2. Apache2, mod_python, and python24 all come
from darwinports. MySQLdb is of course installed, as is MySQL from
Server Logistics. [Perhaps the MySQL version is the problem? Because
the MySQL is not from darwinports, I had to hack the MySQLdb setup.py
file to get it to use the darwinports version of libssl and thus have
exactly the same compatibility version. Should I have hacked something
more?] This is on lhe latest MacOS X 10.3.8.
All these components work fine if I don't import MySQLdb, and MySQLdb
works fine in the python interpreter.
If anyone has any suggestions I'd greatly appreciate them. And BTW I'd
be happy to link statically if that's doable/better/easier.
PS: according to locate (after running locate.update) the only libssl
More information about the Pythonmac-SIG