MySQLdb problem

2 views
Skip to first unread message

Silhyon

unread,
Jun 20, 2007, 1:11:32 PM6/20/07
to Django users
I am trying to install MySqldb on my Macbook Pro for development
purpose, but I keep running into problems when I check to see if
MySQLdb has installed right when I use it in the python console.
Before I get to the problem I should let everyone know the specs of my
machine.

I am running OSX 10.4.9 on a "Santa Rose" Macbook Pro
Python Version: 2.5 (r25:51918)
MySql Version: 5.0.41
MySQLdb Version: 1.2.2

Now the problem I am running into seem similar to the one that was
causing a MySQL with ruby on rails. The problem was rails not being
able to find where the new install had put MySQL's
libmysqlclient_r.dylib.

Here is the print out I am getting:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/PIL/__init__.py", line 19, in <module>

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/silhyon/.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/silhyon/.python-eggs/MySQL_python-1.2.2-
py2.5-macosx-10.3-fat.egg-tmp/_mysql.so
Reason: image not found

I am unsure of how to fix this problem and googling has got me
nothing. Any help would be appreciated on this matter. Also I am
fairly new to Django and Python itself but am ok with using the
terminal and with terminal commands.

Thanks to all answers in advance

StephenF

unread,
Jun 21, 2007, 2:10:50 AM6/21/07
to Django users
Silhyon,
I had a similar problem with MySQLdb concerning a different Library on
my MacBook pro.

Check out this page:
http://www.agapow.net/programming/python/installing-mysqldb

Towards the bottom of his post you will see a bit about "Later News"
where he describes a problem similar to yours.
The fix for me was to "delete the mySQLdb egg and delete the line
referring to it in the easy-install.pth file." and then reinstall
MySQLdb using the Mac Binary Package instead of from the tarball.

Hopefully this will work for you as well,
-Stephen

Silhyon

unread,
Jun 25, 2007, 11:56:18 PM6/25/07
to Django users
This solution would work if the version of Python I had installed was
2.4, unfortunately I am on 2.5 does not have a binary package for 2.5
and it seems that a work around is not around.
I am wondering if I can just uninstall 2.5 and install 2.4 and go from
there. Thanks for trying to put me on the right track StephenF.

-Silhyon

Reply all
Reply to author
Forward
0 new messages