0

I am attempting to migrate an SQL database with 'flask-migrate'. However, after initializing the db I run flask db migrate resulting in the following:

ImportError: dlopen(/Users/eointraynor/Envs/my-wenv/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: /usr/local/mysql/lib/libmysqlclient_r.16.dylib
  Referenced from: /Users/eointraynor/Envs/my-wenv/lib/python2.7/site-packages/_mysql.so

However, there is a later version of that library in that directory: libmysqlclient.20.dylib.

I'm not exactly sure what the root cause of this is, so am uncertain about how to approach a solution.

I have my dependencies inside a virtualenvwrapper and am also working with:

  • Flask-SQLAlchemy
  • MySQL-python
  • SQLAlchemy
Eoin Traynor
  • 600
  • 4
  • 8
  • Looking at one of the answers over here http://stackoverflow.com/questions/8740868/mysql2-gem-compiled-for-wrong-mysql-client-library I wonder if you uninstalled then reinstalled MySQL-Python if that would do anything... – mechanical_meat Mar 31 '17 at 20:19
  • Looks like when you installed MySQL-Python, a binary version was used, but the version that you've got is incompatible with the MySQL client you have on your system. You may want to uninstall the package, then install it again as `pip install --no-binary mysql-python`, to force it to build from source, using the MySQL client libraries in your system. – Miguel Grinberg Apr 01 '17 at 16:42

0 Answers0