[Pythonmac-SIG] mod_python / lib compatibility question

Jim Muller jim at monkeybiz.stanford.edu
Sun Mar 20 22:26:24 CET 2005


Hi,

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

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

	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:  
0.9.0)

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.

   Jim


PS:  according to locate (after running locate.update) the only libssl  
are:

	/Applications/Firefox.app/Contents/MacOS/libssl3.dylib
	/Applications/Navigator.app/Contents/MacOS/libssl3.dylib
	/opt/local/lib/libssl.0.9.7.dylib
	/opt/local/lib/libssl.0.dylib
	/opt/local/lib/libssl.a
	/opt/local/lib/libssl.dylib
	/opt/local/var/db/dports/software/openssl/0.9.7e_0/opt/local/lib/ 
libssl.0.9.7.dylib
	/opt/local/var/db/dports/software/openssl/0.9.7e_0/opt/local/lib/ 
libssl.0.dylib
	/opt/local/var/db/dports/software/openssl/0.9.7e_0/opt/local/lib/ 
libssl.a
	/opt/local/var/db/dports/software/openssl/0.9.7e_0/opt/local/lib/ 
libssl.dylib
	/usr/lib/libssl.0.9.7.dylib
	/usr/lib/libssl.0.9.dylib
	/usr/lib/libssl.dylib
	/usr/libexec/gdb/symfiles/libssl.0.9.7.dylib.syms
	/usr/libexec/gdb/symfiles/libssl.0.9.dylib.syms
	/usr/libexec/httpd/libssl.so


	-- Jim



More information about the Pythonmac-SIG mailing list