Home  >  Article  >  Backend Development  >  Why is `mysql_config` not found when installing `mysql-python` via pip on Ubuntu?

Why is `mysql_config` not found when installing `mysql-python` via pip on Ubuntu?

DDD
DDDOriginal
2024-11-15 06:27:02649browse

Why is `mysql_config` not found when installing `mysql-python` via pip on Ubuntu?

Issues Installing mysql-python via pip on Ubuntu

While attempting to install mysql-python using pip, an error message indicates that mysql_config is not found. This error occurs due to the absence of mysql_config on the system or the inability of the installer to locate it.

Solution

To resolve the issue, ensure that mysql_config is installed on your system. For Debian/Ubuntu-based systems, install the required package:

sudo apt-get install libmysqlclient-dev

In the case of self-compilation of the MySQL suite, mysql_config may not be added to the path.

Recent Ubuntu Systems

For recent versions of Debian/Ubuntu (as of 2018), use the following command:

sudo apt install default-libmysqlclient-dev

Once mysql_config has been correctly installed or added to the path, you should be able to successfully install mysql-python using pip.

The above is the detailed content of Why is `mysql_config` not found when installing `mysql-python` via pip on Ubuntu?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn