MySQLdb problem in conjunction with MAMP

16 views
Skip to first unread message

Don Fox

unread,
Dec 27, 2009, 12:15:03 PM12/27/09
to django...@googlegroups.com
I'm trying to setup MySQLdb but mysql is located @  /Applications/MAMP/Library/bin/mysql because of the installation of MAPI.

My  .profile has:  export PATH="/usr/local/bin:/usr/local/sbin:/Applications/MAMP/Library/bin:$PATH"

The 'python 'setup.py build' and 
       ' sudo python setup.py install'  cmds seem to go as expected but I get this when attempting to import it.

python manage.py shell
Python 2.6.1 (r261:67515, Jul  9 2009, 14:20:26) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.shortcuts import render_to_response
>>> import MySQLdb
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Library/Python/2.6/site-packages/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg/MySQLdb/__init__.py", line 19, in <module>
  File "/Library/Python/2.6/site-packages/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg/_mysql.py", line 7, in <module>
  File "/Library/Python/2.6/site-packages/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/donfox1/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so, 2): Library not loaded: /usr/local/mysql/lib/libmysqlclient_r.16.dylib
  Referenced from: /Users/donfox1/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so
  Reason: image not found


Does anyone know a fix?

Thanks

Don Fox

Raja

unread,
Dec 27, 2009, 12:20:39 PM12/27/09
to Django users
You need the Mysql-dev package. Im not familiar with OSX but in Linux,
you need the libmysqlclient-dev package that contains the load
libraries for python-mysql support.
Also, you might have better luck in the
http://sourceforge.net/projects/mysql-python/forums/forum/70461 forums
as your problem seems to be more mysql-python related.
Reply all
Reply to author
Forward
0 new messages