pip 更换国内镜像

方法 1

C:\Users\85249\AppData\Roaming位置新建一个pip文件夹(之前已经有了就不用管)
pip 更换国内镜像_第1张图片
在文件夹里面新建一个pip.ini文件。
pip 更换国内镜像_第2张图片
文件一开始是空的,用文本文档打开后写入如下文所示。这里使用的是清华源,而且设置为信任,也可以换成其他的源。

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

文件内容如下:
pip 更换国内镜像_第3张图片

方法 2

C:\Users\85249文件夹中新建pip文件夹(如果没有的话),其余步骤一样。

其他

阿里云镜像:
http://mirrors.aliyun.com/pypi/simple/

临时安装包实例
pip install 包名 -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

你可能感兴趣的:(pip,更换源)