How to fix pip install mysql-python fails with EnvironmentError: mysql_config not found?

Sometimes, we want to fix pip install mysql-python fails with EnvironmentError: mysql_config not found.

In this article, we’ll look at how to fix pip install mysql-python fails with EnvironmentError: mysql_config not found.

How to fix pip install mysql-python fails with EnvironmentError: mysql_config not found?

To fix pip install mysql-python fails with EnvironmentError: mysql_config not found, we install the default-libmysqlclient-dev package.

To install the package in Debian or Ubuntu based Linux distros, we run

sudo apt install default-libmysqlclient-dev

Conclusion

To fix pip install mysql-python fails with EnvironmentError: mysql_config not found, we install the default-libmysqlclient-dev package.