Largaroth Largaroth - 1 year ago 224
MySQL Question

Upgraded to Ubuntu 16.04 now MySQL-python dependencies are broken

I just upgraded my Ubuntu install to 16.04 and this seems to have broken my mysql dependencies in the MySQL-python package.

Here is my error message:

File "/opt/monitorenv/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 386, in create_engine
return strategy.create(*args, **kwargs)
File "/opt/monitorenv/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 75, in create
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/opt/monitorenv/local/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/", line 92, in dbapi
return __import__('MySQLdb')
File "/opt/monitorenv/local/lib/python2.7/site-packages/MySQLdb/", line 19, in <module>
import _mysql
ImportError: cannot open shared object file: No such file or directory

So basically the import_mysql is looking for an
file that doesn't exist because in Ubuntu 16.04, I have
And libmysqlclient18 is not available.
As far as I am aware (or at least I believe) my python libraries are up to date with the latest versions.

(I tried running
pip install --upgrade mysql-python
which indicated it was up to date).

Do you guys have any suggestions ?

Answer Source

I ended up finding the solution to my problems with pip install --no-binary MySQL-python MySQL-python as stated in this thread : Python's MySQLdb can’t find libmysqlclient.dylib with Homebrewed MySQL

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download