0
点赞
收藏
分享

微信扫一扫

python - DB - mysqlclient安装

f12b11374cba 2022-07-12 阅读 53

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报错如下:

python - DB - mysqlclient安装_mysql

 解决步骤:

1)打开终端,安装mysql-connector-c

brew install

此过程较慢,大约会持续2个小时左右

2)在~/.bash_profile中加入mysql.的路径

export PATH=${PATH}:/usr/local/Cellar/mysql-client/8.0.19/bin/
source .bash_profile # 使配置文件生效

3)安装mysqlclient

pip3 install

4) 创建软链接

ln -s /usr/local/Cellar/mysql-client/8.0.19/bin/mysql_config /usr/local/bin/mysql_config

5)再次安装,成功~

python - DB - mysqlclient安装_bash_02

 



举报

相关推荐

0 条评论