我試圖在Django上構建一個應用程序,我想使用MySQL作爲數據庫。在設置settings.py後,我嘗試遷移。然後我得到了明顯的錯誤,說MySQL沒有安裝。所以序安裝MySQL,我跑:MYSQL- python pip安裝錯誤
sudo -H pip install MySQL-python
我得到以下錯誤:
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 1, in <module>
File "/private/tmp/pip-build-zAMhWo/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
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-zAMhWo/MySQL-python/
我該如何解決這個問題?
的可能的複製[MySQL的\ _config安裝MySQLdb的蟒接口時未找到(http://stackoverflow.com/questions/7475223/mysql-config-not-found-when -installing-mysqldb-python-interface) –