#233 Wrong library path under Mac OS X 10.4 & Python 2.4

MySQLdb-1.2
open
MySQLdb (285)
5
2012-09-19
2007-08-06
S.J.S.
No

The path to the libmysqlclient_r.15.dylib is wrong under Mac OS X 10.4 in connection with Python 2.5 and MySQL 5 (standard disk image from mysql.com):

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.3-fat/egg/MySQLdb/init.py", line 19, in <module>
ImportError: dlopen(./_mysql.so, 2): Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient_r.15.dylib
Referenced from: ./_mysql.so
Reason: image not found

The actual path is normally /usr/local/mysql/lib/libmysqlclient_r.15.dylib

but somehow, an additional mysql/ is added after lib/ :
/usr/local/mysql/lib/mysql/libmysqlclient_r.15.dylib

Is there a way to give the program the correct path? Is this a problem from the mysql_config program? It seems to show the path like this:
Usage: /usr/local/mysql/bin/mysql_config [OPTIONS]
Options:
--cflags [-I/usr/local/mysql/include -Os -arch i386 -fno-common]
--include [-I/usr/local/mysql/include]
--libs [-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lm]
--libs_r [-L/usr/local/mysql/lib/mysql -lmysqlclient_r -lz -lm]
--socket [/tmp/mysql.sock]
--port [3306]
--version [5.0.45]
--libmysqld-libs [-L/usr/local/mysql/lib/mysql -lmysqld -lz -lm]

but I didn't change that after installation and other programs requiring this path seem to work fine...

Discussion

  • S.J.S.

    S.J.S. - 2007-08-06

    Logged In: YES
    user_id=1645935
    Originator: YES

    sorry, I mistyped the Python version in the title, it's 2.5 as stated in the text.

     
  • Amit

    Amit - 2007-09-07

    Logged In: YES
    user_id=1777921
    Originator: NO

    Hi,

    I am using MacBook (Intel) and having similar issues as above. The other specification are:
    - Python 2.5
    - MySQL 5.0.45

    The one difference is when I execute the mysql_config, i get a slightly different result:
    Usage: /usr/local/mysql/bin/mysql_config [OPTIONS]
    Options:
    --cflags [-I/usr/local/mysql/include -Os -arch i386 -fno-common]
    --include [-I/usr/local/mysql/include]
    --libs [-L/usr/local/mysql/lib -lmysqlclient -lz -lm]
    --libs_r [-L/usr/local/mysql/lib -lmysqlclient_r -lz -lm]
    --socket [/tmp/mysql.sock]
    --port [3306]
    --version [5.0.45]
    --libmysqld-libs [-L/usr/local/mysql/lib -lmysqld -lz -lm] <===== Difference in the last line.

    Hope it helps in resolving the problems.

    Regards,

    Amit

     

Log in to post a comment.