CentOS 7,python2.7 installs Python-mysqldb because it is minimized and relies on other tools or packages during installation
[Email protected] ~]# Pipinstall Mysql-python
Error: Command "python setup.py egg_info" failed with error code 1 in/tmp/pip-build-gme83p/mysql-python/
Install the following two packages via Yum;
[email protected] ~]# Yum install Mysql-devel
[email protected] ~]# Yum Installpython-devel
installation, the following error, the need to install the GCC compiler tool,
Command "/usr/bin/python-u-C" Import setuptools, tokenize;__file__= '/tmp/pip-build-u2yiqi/mysql-python/setup.py '; f =getattr (tokenize, ' open ', open) (__file__); Code=f.read (). replace (' \ r \ n ', ' \ n '); F.close (); Exec (compile (code, __file __, ' exec ')) "Install--record/tmp/pip-iogwbl-record/install-record.txt--single-version-externally-managed-- Compile "failed with error code 1 in/tmp/pip-build-u2yiqi/mysql-python/
[[Email protected] ~] #yum Install GCC
installation Pip need to install first Setuptools
Https://pypi.python.org/pypi/setuptools
[[Email protected] setuptools-36.0.1]# pip install Mysql-python
Collecting Mysql-python
Using Cached Mysql-python-1.2.5.zip
Installing collected Packages:mysql-python
Running setup.py Install for Mysql-python ... done
This article from "Without Your City" blog, declined reprint!
Python-mysqldb Interface Program Installation