[BioPython] Error for installation of MySALdb on Mac OS X

Steve Lianoglou lists.steve at arachnedesign.net
Wed Oct 3 14:47:41 UTC 2007


> Steve, thank you very much. It fixed the problem and I got through  
> the build and install step. But when I tested inside the python for  
> the installation I got following error. Please help me about it.  
> Thanks.
>
> >>> import MySQLdb
> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ 
> site-packages/MySQL_python-1.2.2-py2.5-macosx-10.3-fat.egg/ 
> _mysql.py:3: UserWarning: Module _mysql was already imported from / 
> Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- 
> packages/MySQL_python-1.2.2-py2.5-macosx-10.3-fat.egg/_mysql.pyc,  
> but /Applications/Python_Bio/MySQL-python-1.2.2 is being added to  
> sys.path
>   import sys, pkg_resources, imp
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "MySQLdb/__init__.py", line 19, in <module>
>     import _mysql
>   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in  
> <module>
>   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in  
> __bootstrap__
> ImportError: dlopen(/Users/lizhexu/.python-eggs/MySQL_python-1.2.2- 
> py2.5-macosx-10.3-fat.egg-tmp/_mysql.so, 2): Library not loaded: / 
> usr/local/mysql/lib/mysql/libmysqlclient_r.15.dylib
>   Referenced from: /Users/lizhexu/.python-eggs/MySQL_python-1.2.2- 
> py2.5-macosx-10.3-fat.egg-tmp/_mysql.so
>   Reason: image not found


Sorry, don't know exactly what's happening here. Is this from a  
"fresh" python prompt?

How did you install MySQLdb, did you use easy_install? If so, try to  
install from the sourceforge download.

Try to remove it, remove the "build" directory from your mysqldb  
download and redo the whole
python setup.py build / python setup.py install process

To remove it, nuke this:
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- 
packages/MySQL_python-1.2.2-py2.5-macosx-10.3-fat.egg

And try to reinstall?

Perhaps someone who knows what the problem is here can give you a  
better idea on what to do.

-steve



More information about the Biopython mailing list