Specific error message:
[Email protected]/4 $ pip Install mysql-pythoncollecting Mysql-python Using cached mysql-python-1.2.5.zip complete output from command python setup.pyEgg_info:rh[Mysql_config:commandNot found Traceback (most recent call last): File"<string>", line1,In <Module> File"/tmp/pip-build-kwowp9/mysql-python/setup.py", line17, in < module> metadata, Options = Get_config () File "Setup_ posix.py ", line 43, in get_config libs = mysql_config ( "Libs_r") File "setup_posix.py", line 25, in Mysql_config raise EnvironmentError ( "%s not found"% (mysql_ Config.path,)) environmenterror:mysql_config not found------ ----------------------------------Command "python setup.py egg_info" failed with error code 1 in/tmp/pip-build-kwowp9/mysql-python/
Mysql_config is from mysql-devel
, I'm using the MySQL Community edition, so the actual installation is mysql-community-devel
that the online statement is installed at the same time python-devel
, if you did not install it together
yum install python-devel mysql-community-devel -y
Try pip install again after installation is complete Mysql-python
Install again
[email protected]/4 $ pip install MySQL-pythonCollecting MySQL-python Using cached MySQL-python-1.2.5.zipInstalling collected packages: MySQL-python Running setup.py install for MySQL-python ... doneSuccessfully installed MySQL-python-1.2.5
Verify
[Email protected]/1 $ pythonpython2.7.5 (Default, SEP152016,22:37:[GCC]4.8.520150623 (Red Hat4.8.5-4)] on Linux2type"Help","Copyright","Credits"Or"License"For more information.>>> Import MySQLdb>>> MySQLdb.MySQLdb.BINARY Mysqldb.operationalerror (mysqldb.__hash__ (Mysqldb.debug (Mysqldb.binary (Mysqldb.programmingerror (mysqldb.__init__ (Mysqldb.escape (MySQLdb.connect (Mysqldb.rowid mysqldb.__name__ Mysqldb.escape_dict (mysqldb.connection (mysqldb.string mysqldb.__new__ (Mysqldb.escape_sequence (mysqldb.date mysqldb.time Mysqldb.__package__ Mysqldb.escape_string (mysqldb.datetime mysqldb.timestamp mysqldb.__path__ Mysqldb.get_client_info (Mysqldb.dbapiset (Mysqldb.time (mysqldb.__reduce__ (MySQLdb.paramstyleMySQLdb.DataError (Mysqldb.timefromticks (mysqldb.__reduce_ex__ (MySQLdb.releaseMySQLdb.DatabaseError (Mysqldb.timestamp (mysqldb.__repr__ (Mysqldb.result (Mysqldb.date (Mysqldb.timestampfromticks (mysqldb.__revision__ Mysqldb.server_end (Mysqldb.datefromticks (mysqldb.warning (mysqldb.__setattr__ (Mysqldb.server_init (Mysqldb.error (Mysqldb.__all__ Mysqldb.__sizeof__ (Mysqldb.string_literal (Mysqldb.field_type mysqldb.__author__ Mysqldb.__str__ (Mysqldb.test_dbapiset_set_equality (Mysqldb.integrityerror (Mysqldb.__class__ (Mysqldb.__subclasshook__ (Mysqldb.test_dbapiset_set_equality_membership (Mysqldb.interfaceerror (mysqldb.__delattr__ (Mysqldb.__version__ mysqldb.test_dbapiset_set_inequality ( Mysqldb.internalerror (Mysqldb.__dict__ mysqldb._mysql mysqldb.test_dbapiset_set_ Inequality_membership (Mysqldb.mysqlerror (Mysqldb.__doc__ MySQLdb.apilevel Mysqldb.thread_safe (mysqldb.null mysqldb.__file__ mysqldb.connect ( MySQLdb.threadsafetyMySQLdb.NUMBER mysqldb.__format__ (Mysqldb.connection ( MySQLdb.timesMySQLdb.NotSupportedError (Mysqldb.__getattribute__ (mysqldb.constants Mysqldb.version_info>>> >>> mysqldb.version_info ( 1, 2, 5, ' Final ', 1) >>>
Full stack operation and maintenance
Links: Https://www.jianshu.com/p/827cf26568d8
Source: Pinterest
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
Python[error]-Mysql_config not found