Menu

MySQLdb/Djan problem in conjunction with MAMP

Don Fox
2009-12-28
2012-09-19
  • Don Fox

    Don Fox - 2009-12-28

    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)

    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></module></console>

    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></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></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

     
  • Andy Dustman

    Andy Dustman - 2009-12-28

    It seems to be looking for the MySQL libs in /usr/local/mysqli/lib. See what
    this produces:

    $ which mysql_config

    $ mysql_config --libs

    Is it possible also that you had a version of MySQL installed in /usr/local at
    one time (or still do)? You might want to put MAMP earlier in your $PATH.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.