4

Im on mac Sierra i have installed MySQLdb for python

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

and also following https://www.tutorialspoint.com/python/python_database_access.htm

i have tried to import MySQLdb

>>> 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

i have rechecked if MySQLdb was install but heres the msg it shows

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

how do i fix this?

Wasif Khalil
  • 2,217
  • 9
  • 33
  • 58

0 Answers0