python mysqlclient安装失败 Command "python setup.py egg_info" failed with error code 1

版权声明:版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/DarrenXf/article/details/83108075

python2 python3 中代码

pip install mysqlclient

都安装失败的话,
很有可能是你的操作系统中没有安装mysql
如果确定已经安装了,请忽略下面的内容.
Ubuntu 下安装 mysql的方法

sudo apt-get -y install mysql-server                                            
sudo apt-get -y install mysql-client                                            
sudo apt-get -y install libmysqlclient-dev

运行上面的shell代码可以安装mysql
然后

pip install mysqlclient

可以再python2 和python3中安装
但是mysqlclient 只更新到3.4
在python3.5中需要安装pymysql

pip install PyMySQL

注 这里pip 时环境中只有一个python ,只有python2或者python3

猜你喜欢

转载自blog.csdn.net/DarrenXf/article/details/83108075
今日推荐