[Pythonmac-SIG] 64-bit mode no work
Ned Deily
nad at acm.org
Sun Feb 22 23:26:15 CET 2009
In article <378C26CA-4CF5-4DD6-B2BB-0D24B8AA7906 at raeder.dk>,
Lars Clausen <lars at raeder.dk> wrote:
Sorry, it's a bit difficult to tell what's going on here with all the
changing pieces but one thing stands out: there's something very
suspicious about the path names showing up in your tracebacks. Note
here:
> 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:
The paths for the python files in MySQLdb do not look like they come
from a normal installed egg. Compare:
"build/bdist.macosx-10.5-universal/egg/_mysql.py"
to the path for the c extension:
"/Users/larsrc/.python-eggs/MySQL_python-1.2.2-py2.6-macosx-10.5-universa
l.egg-tmp/_mysql.so"
The latter looks correct. _mysql.so and _mysql.py should be in the
same directory which probably explains the problem in your second
example after rebuilding:
> >>> 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)
Depending on you settings, the installed egg may just be one zip file.
If you look at the unzipped version, the layout of the top level of the
egg should look something like this:
EGG-INFO/
MySQLdb/
_mysql.py*
_mysql.pyc
_mysql.pyo
_mysql.so*
_mysql_exceptions.py*
_mysql_exceptions.pyc
_mysql_exceptions.pyo
So it looks like there's something wrong with your sys.path here. Are
you using your python-64 to install the built egg to its site-packages
directory? It should just work.
cd build
/path/to/python-64 setup.py clean
/path/to/python-64 setup.py build
sudo /path/to/python-64 setup.py install
Don't know about the path for running under mod_python though.
--
Ned Deily,
nad at acm.org
More information about the Pythonmac-SIG
mailing list