Python 快速配置镜像源

Python 快速配置镜像源

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config set install.trusted-host mirrors.aliyun.com

pip config set 命令能自动把配置写入到用户对应的配置文件中:

[global]
index-url = https://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com

pip config list 命令可以显示已经有了哪些配置:

pip config list
global.index-url=‘http://mirrors.aliyun.com/pypi/simple/’
install.trusted-host=‘mirrors.aliyun.com’

在这里插入图片描述