更新PIP更换国内镜像源

#默认自动安装
python -m pip install --upgrade pip

#一般库的本地安装
pip install filename.whl

#pip的本地安装及版本显示
python -m pip install pip-20.0.2-py2.py3-none-any.whl
或直接
python -m pip install --upgrade pip -i https://pypi.mirrors.ustc.edu.cn/simple/

pip -V

pip项目下载地址

国内镜像源

https://pypi.tuna.tsinghua.edu.cn/simple     #清华
http://mirrors.aliyun.com/pypi/simple/       #阿里云
https://pypi.mirrors.ustc.edu.cn/simple/     #中国科技大学
http://pypi.hustunique.com/                  #华中理工大学
http://pypi.sdutlinux.org/                   #山东理工大学
http://pypi.douban.com/simple/               #豆瓣    

临时修改镜像源

pip install *** -i http://mirrors.aliyun.com/pypi/simple/

Windows下修改镜像源

在users文件夹下创建pip安装配置文件,文件名为pip.ini。一般路径为:C:\Users\**\pip/pip.ini,其中**表示计算机使用者的名字。

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

linux下修改配置文件的方法

修改~/.pip/pip.conf 该配置文件,如果文件不存在,则需自行创建文件。.表示Linux下的隐藏文件,.必须加上。

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com

 


版权声明:本文为shiyanwy原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。