跳到主要内容
  1. Posts/

Python 中 pip 设置为阿里镜像源

··20 字·1 分钟·

配置文件 #

a. 找到下列文件

Linux 在~/.pip/pip.conf,Windows 在~/AppData/Roaming/pip/pip.ini

b. 在上述文件中添加或修改:

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

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

使用命令设置 #

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