close

[Solved] pip install mysql-python fails with EnvironmentError: mysql_config not foundv

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error pip install mysql-python fails with EnvironmentError: mysql_config not foundv in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How pip install mysql-python fails with EnvironmentError: mysql_config not foundv Error Occurs?

Today I get the following error pip install mysql-python fails with EnvironmentError: mysql_config not foundv in python.

How To Solve pip install mysql-python fails with EnvironmentError: mysql_config not foundv Error ?

  1. How To Solve pip install mysql-python fails with EnvironmentError: mysql_config not foundv Error ?

    To Solve pip install mysql-python fails with EnvironmentError: mysql_config not foundv Error Maybe the mysql_config is not in your path, it will be the case when you compile by yourself the mysql suite.

  2. pip install mysql-python fails with EnvironmentError: mysql_config not foundv

    To Solve pip install mysql-python fails with EnvironmentError: mysql_config not foundv Error Maybe the mysql_config is not in your path, it will be the case when you compile by yourself the mysql suite.

Solution 1

If you are on MAC Install this globally

brew install mysql

then export path like this

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

Than globally or in your venv whatever you like

pip install MySQL-Python

Note: globally for python3 as Mac can have both python2 & 3

pip3 install MySQL-Python

Solution 2

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 yourself the mysql suite.

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

sudo apt install default-libmysqlclient-dev

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read