Python installation mysqldb mysql_config not fount cause

Source: Internet
Author: User

The following errors occur in both Pip and Apt-get when installing the MySQLdb module.

[Email protected]:~# cd mysql-python-1.2.3[email protected]:~/mysql-python-1.2.3# python setup.py install Sh:mysql_ Config:not Foundtraceback (most recent): File ' setup.py ', line, <module> metadata, options = ge T_config () file "/root/mysql-python-1.2.3/setup_posix.py", line +, in Get_config libs = Mysql_config ("libs_r") file "/root/mysql-python-1.2.3/setup_posix.py", line, in Mysql_config raise EnvironmentError ('%s not found '% (mysql_conf Ig.path,)) Environmenterror:mysql_config not found

This is due to a lack of Libmysqld_dev, Libmysqlclient_dev two development packages.

In the installation process directly apt the two packages, while modifying the source code directory under the setup_posix.py file,

Modify Mysql_config.path to Mysql_config.path= "/usr/bin/mysql_config"

The PIP installation is successful again.

Python installation mysqldb mysql_config not fount cause

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.