pip 安裝 mysql_python “EnvironmentError: mysql_config not found” 問題解決方法

錯誤:

pip install MySQL-python

You are using pip version 7.1.0, howeverversion 8.1.1 is available.

You should consider upgrading via the 'pipinstall --upgrade pip' command.

Collecting MySQL-python

 Using cached MySQL-python-1.2.5.zip

   Complete output from command python setup.py egg_info:

   sh: mysql_config: command not found

   Traceback (most recent call last):

     File "<string>", line 20, in <module>

     File "/tmp/pip-build-BIzI3N/MySQL-python/setup.py", line 17,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

解決方法:

yum install python-devel

yum install mysql-devel

yum install gcc


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章