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

Y Tu ytu888 at hotmail.com
Tue Oct 16 17:06:36 UTC 2007


Hi,

I reinstalled everything and checked every step. I found that there are had some warnings in 'build" step (underlined) . I wonder if they are the reason why I got the error messages when running "import MySQLdb" under the python prompt and how to fix the problem.
Thank you very much.

LeesComputer:/Applications/Python_Bio/MySQL-python-1.2.2 Lee$ python setup.py build
running build
running build_py
... ...
/usr/bin/ld: for architecture ppc
/usr/bin/ld: warning build/temp.macosx-10.3-fat-2.5/_mysql.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /usr/local/mysql/lib/libmysqlclient_r.dylib cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
LeesComputer:/Applications/Python_Bio/MySQL-python-1.2.2 Lee$ sudo python setup.py install
Password:
running install
... ...
Adding MySQL-python 1.2.2 to easy-install.pth file

Installed /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-macosx-10.3-fat.egg
Processing dependencies for MySQL-python==1.2.2
LeesComputer:/Applications/Python_Bio/MySQL-python-1.2.2 Lee$ python
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) 
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 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/Lee/.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/Lee/.python-eggs/MySQL_python-1.2.2-py2.5-macosx-10.3-fat.egg-tmp/_mysql.so
  Reason: image not found

> CC: biopython at lists.open-bio.org
> From: lists.steve at arachnedesign.net
> Subject: Re: [BioPython]  Error for installation of  MySALdb on Mac OS X
> Date: Mon, 15 Oct 2007 12:30:21 -0400
> To: ytu888 at hotmail.com
> 
> Hi,
> 
> > Thank you for your email. I was away for a week.
> > What do you mean "fresh" python prompt?
> > I installed MySQL by using MYSQL-5.0.45-osx10.4-i686.dmg downloaded  
> > online.
> > I guess you want me to reinstall MySQL_python_1.2.2, not MySQLdb,  
> > am I right?
> 
> I'm not sure, exactly.
> 
> Last time I checked, the only thing you needed to use mysql from  
> python was:
> 
> (a) A working mysql install (the client/server)
> (b) The mysqldb package from: http://sourceforge.net/projects/mysql- 
> python
> 
> I'm assuming (a) is installed correctly since you are using the .mpkg  
> from mysql.org, so I'd just try to fix (b).
> 
> You try do so by doing the following:
> 
> (1) Remove your original attempt at installing the python mysqldb  
> library. From the looks of your error messages, it seems to be  
> installed here:
> 
> Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- 
> packages/MySQL_python-1.2.2-py2.5-macosx-10.3-fat.egg/
> 
> (2) remove the build directory in your mysqldb directory (the one you  
> are installing from) by cd-ing into your mysqldb download, and  
> removing the build directory you find there.
> 
> (3) reinstall mysqldb by doing the usual `pythong setup.py build` and  
> `sudo python setup.py install` dance
> 
> For the record, I'm not sure what you are talking about when you are  
> distinguishing between "MySQL_python_1.2.2, not MySQLdb"
> 
> are you trying to install two python libraries to access mysql?
> 
> -steve
> 

_________________________________________________________________
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us



More information about the Biopython mailing list