先把以前裝的卸載乾淨:
pip uninstall mysql-python
brew uninstall mysql-connector-cpython
如今設置下mysql_config路徑:
首先修改系統配置文件vim ~/.bash_profile或者有些人是 ~/.profile,mysql
export PATH=$PATH:/Applications/MAMP/Library/bin
這裏/Applications/MAMP/Library/bin是MAMP的mysql配置文件路徑sql
安裝
brew install mysql-connector-c
pip install mysql-pythonvim
搞定!bash