1. windows環境:
pycharm中,terminal使用以下命令:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple requests mysqlclient
排坑:
安裝了一個3.8版本的Python,折騰了一天,怎么都裝不上。換成Python3.7, ok~
2. mac環境
mac上執行pip install -i https://pypi.tuna.tsinghua.edu.cn/simple requests mysqlclient報錯如下:
解決步驟:
1)打開終端,安裝mysql-connector-c
brew install mysql-connector-c
此過程較慢,大約會持續2個小時左右
2)在~/.bash_profile中加入mysql.的路徑
export PATH=${PATH}:/usr/local/Cellar/mysql-client/8.0.19/bin/
source .bash_profile # 使配置文件生效
3)安裝mysqlclient
pip3 install mysqlclient
4) 創建軟鏈接
ln -s /usr/local/Cellar/mysql-client/8.0.19/bin/mysql_config /usr/local/bin/mysql_config
5)再次安裝,成功~