0

So I am working on a python project which needs MySQL. I work on macOS Mojave. For this earlier I had installed MySQL using homebrew:

brew install mysql@5.7

However, later I realised I need MySQL 5.6. So I did the following:

brew remove mysql@5.7
brew install mysql@5.6

Now when I open python 2.7, and import MySQLdb, I get the following error:

import MySQLdb

I get the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/97amarnathk/miniconda3/envs/py27_dirac/lib/python2.7/site-packages/MySQLdb/__init__.py", line 19, in <module>
    import _mysql
ImportError: dlopen(/Users/97amarnathk/miniconda3/envs/py27_dirac/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: /usr/local/opt/mysql@5.7/lib/libmysqlclient.20.dylib
  Referenced from: /Users/97amarnathk/miniconda3/envs/py27_dirac/lib/python2.7/site-packages/_mysql.so
  Reason: image not found

It is looking for MySQL 5.7 but I have installed MySQL 5.6.

So how do I make the system use MySQL 5.6?

97amarnathk
  • 957
  • 2
  • 11
  • 30

0 Answers0