Home > Database > Mysql Tutorial > body text

How to Fix 'ImportError: dlopen(...: Library not loaded: libmysqlclient.16.dylib)' in Python on Mac 10.6?

Linda Hamilton
Release: 2024-11-07 09:54:03
Original
498 people have browsed it

How to Fix

Python import MySQLdb Error on Mac 10.6

Problem:

Attempts to import the MySQLdb python plugin into a python terminal result in the following error:

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
Copy after login

Previously Attempted Solutions:

  • Followed instructions in Stack Overflow question 4559699
  • Applied workaround mentioned in MySQL bug 59006

Workaround for Python on Mac 10.6:

To resolve the issue, add the following symbolic links:

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
Copy after login

The above is the detailed content of How to Fix 'ImportError: dlopen(...: Library not loaded: libmysqlclient.16.dylib)' in Python on Mac 10.6?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template