python配置国内镜像源
windows系统配置python阿里云镜像源
C:\Users\97343\AppData\Local\Programs\Python\Python312
使用命令查看配置文件位置
pip config -v list
windows下默认是没有 pip.ini 配置文件的,需新建,新建完之后写入以下内容
[Global]
index-url='https://mirrors.aliyun.com/pypi/simple/'
timeout='6000'
trusted-host='mirrors.aliyun.com'
验证
C:\Users\97343>pip config -v list
For variant 'global', will try loading 'C:\ProgramData\pip\pip.ini'
For variant 'user', will try loading 'C:\Users\97343\pip\pip.ini'
For variant 'user', will try loading 'C:\Users\97343\AppData\Roaming\pip\pip.ini'
For variant 'site', will try loading 'C:\Users\97343\AppData\Local\Programs\Python\Python312\pip.ini'
global.index-url='https://mirrors.aliyun.com/pypi/simple/'
global.timeout='6000'
global.trusted-host='mirrors.aliyun.com'