原文地址:https://blog.csdn.net/henulwj/article/details/47061527
PIP3
sudo apt-get install python3-pip
修改pip更新源
pip安装时默认访问pypi的,但是pypi的速度对于国内来说有点慢,还在国内也有一些pip的镜像源,造福广大程序员
pipy国内镜像目前有:
http://pypi.douban.com/ 豆瓣
http://pypi.hustunique.com/ 华中理工大学
http://pypi.sdutlinux.org/ 山东理工大学
http://pypi.mirrors.ustc.edu.cn/ 中国科学技术大学
安装时我们可以手动指定安装源如下:
pip -i http://pypi.douban.com/simple install Flask
- 1
如果感觉每次安装都手动指定安装源麻烦的话,也可以配置pip更新源
在主目录下创建.pip文件夹
mkdir ~/.pip
然后在该目录下创建pip.conf文件编写如下内容:sudo gedit ~/.pip/pip.conf 二选一
[global]
trusted-host = pypi.mirrors.ustc.edu.cn
index-url = http://pypi.mirrors.ustc.edu.cn/simple
[global]
trusted-host = mirrors.aliyun.com
index-url = http://mirrors.aliyun.com/pypi/simple
- 3
这里以豆瓣的源为例,由于最新的pip安装需要使用的https加密,所以在此需要添加trusted-host