pip install mysql-python fails with EnvironmentError: mysql_config not found pip install mysql-python fails with EnvironmentError: mysql_config not found python python

pip install mysql-python fails with EnvironmentError: mysql_config not found


It seems mysql_config is missing on your system or the installer could not find it.Be sure mysql_config is really installed.

For example on Debian/Ubuntu you must install the package:

sudo apt-get install libmysqlclient-dev

Maybe the mysql_config is not in your path, it will be the case when you compile by yourselfthe mysql suite.

Update: For recent versions of debian/ubuntu (as of 2018) it is

sudo apt install default-libmysqlclient-dev


In Mac OS, I simply ran this in terminal to fix:

export PATH=$PATH:/usr/local/mysql/bin

This is the quickest fix I found - it adds it to the path, but I think you're better off adding it permanently (ie add it to /etc/paths) if you plan to install MySQL-python in another environment.

(tested in OSX Mountain Lion)


apt-get install libmysqlclient-dev python-dev

Seemed to do the trick.


matomo