報錯內容主要是:
EnvironmentError: mysql_config not found
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/nh/j05szmpj19368dd9_y6whgy40000gq/T/pip-install-n9Jonx/mysql-python/
網上查了執行一個什么環境變量的命令:
export PATH=$PATH:/usr/local/mysql/bin
然后報了另一個錯:
#include "my_config.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'cc' failed with exit status 1
最后用了兩個方法
一是先執行:
brew install mysql
注意一定要是通過brew安裝
二是直接去下載:
下載完以后,通過finder可以訪問到:
/usr/local/mysql/bin??這個文件夾,可以看到里面是有一個叫 mysql_config 的文件
由于我是同時做了這兩件事的,所以無法判斷到底哪個是對哪個是錯,或者都可以,然后再執行一遍:
export PATH=$PATH:/usr/local/mysql/bin
最后再執行 ?pip install MySQL-Python??就好了
參考:
https://stackoverflow.com/questions/25459386/mac-os-x-environmenterror-mysql-config-not-found
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态