On Feb 22, 2009, at 12:00 PM, pythonmac-sig-requ...@python.org wrote:
In article <def20f43-12bb-4397-9214-8c6a292af...@raeder.dk>,
Lars Clausen <l...@raeder.dk> wrote:
I've been trying to get mod_python and mysql to work on my Intel
MacBook Leopard, but with very little luck. [...]
What about the MySQL library itself, i.e. libmysqlclient? Do you
have a
64-bit version of it? The standard distribution from MySQL is not
4-way, (and, for 5.1.30 at least, it's broken for 2-way:
<http://bugs.mysql.com/bug.php?id=41940>).
Hedwig:local larsrc$ ls -ld /usr/local/mysql*
lrwxr-xr-x 1 root wheel 27 Feb 19 20:26 /usr/local/mysql ->
mysql-5.0.77-osx10.5-x86_64
Hedwig:Sources larsrc$ file /usr/local/mysql-5.0.77-osx10.5-x86_64/lib/
libmysqlclient_r.15.0.0.dylib
/usr/local/mysql-5.0.77-osx10.5-x86_64/lib/libmysqlclient_r.
15.0.0.dylib: Mach-O 64-bit dynamically linked shared library x86_64
However, importing MySQLdb in python directly shows something
interesting:
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.5-universal/egg/MySQLdb/__init__.py",
line 19, in <module>
File "build/bdist.macosx-10.5-universal/egg/_mysql.py", line 7, in
<module>
File "build/bdist.macosx-10.5-universal/egg/_mysql.py", line 6, in
__bootstrap__
ImportError: dlopen(/Users/larsrc/.python-eggs/MySQL_python-1.2.2-
py2.6-macosx-10.5-universal.egg-tmp/_mysql.so, 2): Library not
loaded: /usr/local/mysql/lib/libmysqlclient_r.16.dylib
Referenced from: /Users/larsrc/.python-eggs/MySQL_python-1.2.2-
py2.6-macosx-10.5-universal.egg-tmp/_mysql.so
Reason: image not found
It tries to fine the .16 version, but the 64-bit mysql has the .15
version:
Hedwig:local larsrc$ locate libmysqlclient_r | grep .0.0
/usr/local/mysql-5.0.77-osx10.5-x86_64/lib/libmysqlclient_r.15.0.0.dylib
/usr/local/mysql-5.1.31-osx10.5-x86/lib/libmysqlclient_r.16.0.0.dylib
Linking /usr/local/mysql/lib/mysql and recompiling MySQLdb from fresh
sources gave an egg that looks for the .15 version, but now it is back
to the 'does not define init function'. No luck on that.
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.5-universal/egg/MySQLdb/__init__.py",
line 19, in <module>
File "build/bdist.macosx-10.5-universal/egg/_mysql.py", line 7, in
<module>
File "build/bdist.macosx-10.5-universal/egg/_mysql.py", line 6, in
__bootstrap__
ImportError: dynamic module does not define init function (init_mysql)
I have cleared out my old eggs and checked that the egg used here is
64-bit.
Any ideas also why there is no 64-bit installation of Python for Mac?
Given the presence of fat binaries, it seems like it would be a
trivial task to have it.
The support for 4-way universal builds in python is relatively new.
There has been some discussion recently on the python-dev list about
providing "official" 4-way installers for OS X. This will probably
get
discussed more at the upcoming PyCon.
I hope so. All this grief has had me casting about for another
language to do really simple MySQL-to-JSON web services, but I have
found nothing that does it as well as Python and Publisher.
-Lars
_______________________________________________
Pythonmac-SIG maillist - Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig