pip install mysql-python fails with EnvironmentError: mysql_config not found
Occasionaly, when installing the mysql-python package using pip, you may encounter an EnvironmentError: mysql_config not found message. This error indicates the inability of the installer to locate the mysql_config utility, which is crucial for the successful installation of the package.
To resolve this issue, it is necessary to install mysql_config on your system. For Debian and Ubuntu distributions, this can be achieved using the following command:
sudo apt-get install libmysqlclient-dev
For more recent versions of Debian and Ubuntu, the command has been updated to:
sudo apt install default-libmysqlclient-dev
Another potential cause of this error is that mysql_config is not accessible in your system path. If you have compiled the MySQL suite on your own, this scenario is more likely. To rectify this, ensure that mysql_config is included in your path.
After addressing either issue, you should be able to successfully install mysql-python using pip:
pip install mysql-python
The above is the detailed content of Why Does `pip install mysql-python` Fail with `EnvironmentError: mysql_config not found`?. For more information, please follow other related articles on the PHP Chinese website!