Python ImportError: dlopen(/Users/yanigisawa/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.16.dylib on Mac 10.6
The issue you are encountering while importing MySQLdb in Python arises due to a missing library dependency. Specifically, the error message indicates that the dynamic library libmysqlclient.16.dylib cannot be located or loaded.
To resolve this issue, you can take the following steps:
Create Symbolic Links: Manually create symbolic links to the required libraries. In your case, create the following links as suggested in the solution:
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
After implementing these steps, try importing MySQLdb again. The error should be resolved.
The above is the detailed content of How to Fix 'ImportError: dlopen(/Users/yanigisawa/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.16.dylib' on Mac 10.6?. For more information, please follow other related articles on the PHP Chinese website!