Home >Database >Mysql Tutorial >Here are some question-style titles that fit the content of your article: * MySQLdb on Mac OS X: Why am I getting \'Library not loaded: libmysqlclient.16.dylib\'? * How to Fix \'Librar
Python: MySQLdb and "Library not loaded: libmysqlclient.16.dylib"
In an attempt to develop Python/Django applications, you've encountered an issue while installing MySQL-python on Mac OS X 10.6. Despite successfully installing MySQL, importing MySQLdb fails with the error message "Library not loaded: libmysqlclient.16.dylib."
To resolve this issue, you can set the DYLD_LIBRARY_PATH environment variable after running pip install or easy_install:
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
Assuming MySQL is installed in the default location (/usr/local/mysql), this should resolve the issue. The DYLD_LIBRARY_PATH variable tells the system where to look for shared libraries, including the missing libmysqlclient.16.dylib.
The above is the detailed content of Here are some question-style titles that fit the content of your article: * MySQLdb on Mac OS X: Why am I getting \'Library not loaded: libmysqlclient.16.dylib\'? * How to Fix \'Librar. For more information, please follow other related articles on the PHP Chinese website!