在mac上安装MySQLdb但错误“原因:图片未找到”

时间:2018-02-06 12:10:35

标签: python mysql

我在mac Sierra上安装了MySQLdb for python

brew install mysql-connector-c
pip install mysql-python

以及https://www.tutorialspoint.com/python/python_database_access.htm

之后

我试图导入My​​SQLdb

>>> import MySQLdb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/MySQLdb/__init__.py", line 19, in <module>
    import _mysql
ImportError: dlopen(/Library/Python/2.7/site-packages/_mysql.so, 2): Library not loaded: /usr/local/opt/mariadb/lib/libmysqlclient.18.dylib
  Referenced from: /Library/Python/2.7/site-packages/_mysql.so
  Reason: image not found

我已经重新检查了MySQLdb是否已经安装但是它显示的是msg

➜  ~ pip install MySQL-python
Requirement already satisfied: MySQL-python in /Library/Python/2.7/site-packages

我该如何解决这个问题?

0 个答案:

没有答案