CENTOS7 installation Mysql--python module appears environmenterror:mysql_config not found and Error:command ' gcc ' failed with exit status 1

Source: Internet
Author: User
Tags install openssl openssl

To enable Python to operate MySQL requires the Mysql-python driver, which is a necessary module for Python to operate MySQL.

: https://pypi.python.org/pypi/MySQL-python/

Unzip directly after downloading the Mysql-python-1.2.5.zip file. Enter the mysql-python-1.2.5 directory:

Python setup.py Install

Error:

[[email protected] mysql-python-1.2.4]# python setup.py install

Sh:mysql_config:command not found

Traceback (most recent):

File "setup.py", line +, in <module>

metadata, Options = Get_config ()

File "/root/mysql-python-1.2.4/setup_posix.py", line +, in Get_config

Libs = Mysql_config ("Libs_r")

File "/root/mysql-python-1.2.4/setup_posix.py", line +, in Mysql_config

Raise EnvironmentError ("%s not found"% (Mysql_config.path,))

Environmenterror:mysql_config not found

I checked the Internet. Mysql-devel Installation Required

#yum-y Install Mysql-devel

After successful installation

# python setup.py Install

The installation was successful.

[[email protected] mysql-python-1.2.5]# python

Python 2.7.5 (default, June 17 2014, 18:11:42)

[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2

Type "Help", "copyright", "credits" or "license" for more information.

>>> Import MySQLdb

/usr/lib64/python2.7/site-packages/mysql_python-1.2.5-py2.7-linux-x86_64.egg/_mysql.py:3: Userwarning:module _ MySQL was already imported from/usr/lib64/python2.7/site-packages/mysql_python-1.2.5-py2.7-linux-x86_64.egg/_ MYSQL.PYC, but/root/mysql-python-1.2.5 is being added to Sys.path

With the installation of the Python module appears error:command ' GCC ' failed with exit status 1, clearly installed GCC, how can not, and then found that is failed is not found, which shows that this error is not much of GCC relations, Should be missing some functional modules, and then Google a bit, has installed python-devel,libffi-devel or not, and finally found to install Openssl-devel

You can install the following command line:

Yum install gcc libffi-devel python-devel openssl-devel

CENTOS7 installation Mysql--python module appears environmenterror:mysql_config not found and Error:command ' gcc ' failed with exit status 1

Related Article

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.