安装 mysqlclient

安装mysqlclient要先确认是否正确安装并配置好python,django,python对应的库文件python-dev

我自己安装的是python3.6

django2.0

pip install mysqlclient之后报错

看报错好像是gcc的问题,

sudo apt-get build-dep gcc  之后安装mysqlclient还是同样错误

 

尝试安装python3.6-dev

sudo apt-get install python3.6-dev

安装一半时候,下载超时

查看镜像设置

vim /etc/apt/sources.list

deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe

注掉原来的,替换上面的镜像地址进去

再次安装python3.6-dev,成功

安装mysqlclient 成功

 

 

posted @ 2018-07-04 01:03  17-王晶龙-58  阅读(165)  评论(0编辑  收藏  举报