巴扎黑2017-04-18 10:30:26
The problem with my Python2.7 when installing MySQLdb is because I don’t have MySQL on my machine. I finally installed it brew install mysql
, but the error seems to be different from yours... You can try it
迷茫2017-04-18 10:30:26
*
nano ~/.profile
Write the following content
export PATH=/usr/local/mysql/bin:$PATH
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
Save and exit, here I am ctrl + O (save), then Enter (very important), ctrl + X (exit), this editor is such a pain in the ass
Execute code
source ~/.profile
Install MySQLdb
pip2 install MySQL-python
nano ~/.profile
source ~/.profile
pip install mysqlclient