pip多源设置

pip多源设置

一、 pip.ini的配置作用文件介绍

  1. 三个级别的配置文件:系统级别配置ProgramData、用户级别配置x00601234、虚拟环境级别配置
  2. 配置文件读取优先级:从高到低为虚拟>用户>系统。即程序先读取虚拟环境配置,读取不到则读取系统环境配置,以此类推。
  3. 配置文件作用范围:从大到小为系统>用户>虚拟。即系统配置对所有用户生效、用户配置仅在当前用户生效等。

二、 获取pip.init配置文件路径的方法

  • 使用everything搜索"pip.ini"
  • 路径中出现C:/ProgramData为系统级别配置;路径中是C:/Users/x00601234为用户级别配置;路径中出现.conda为虚拟环境级别配置

三、 附pip.ini镜像源参考配置及备注:

  • 注1:增加多个源,提升成功率
  • 注2:重试次数置0,降低网络不通时等待时间。
  • 注3:trusted-host配置域名,避免ssl证书验证导致的下载失败问题。

四、附源设置代码

复制代码
[global]
index-url = https://mirrors.tools.huawei.com/pypi/simple
trusted-host = cmc.centralrepo.rnd.huawei.com mirrors.tools.huawei.com pypi.org pypi.tuna.tsinghua.edu.cn mirrors.aliyun.com mirror.baidu.com pypi.douban.com pypi.mirrors.ustc.edu.cn
extra-index-url = https://cmc.centralrepo.rnd.huawei.com/artifactory/api/pypi/product_pypi/simple/ https://pypi.org/simple https://pypi.tuna.tsinghua.edu.cn/simple https://mirrors.aliyun.com/pypi/simple/ https://mirror.baidu.com/pypi/simple https://pypi.douban.com/simple/ https://pypi.mirrors.ustc.edu.cn/simple/
retries = 0
相关推荐
胡八一1 天前
解决使用PCbuild\build.bat构建python之后,运行pip报错
开发语言·python·pip
万粉变现经纪人2 天前
如何解决 pip install 网络报错 403 Forbidden(访问被阻止)问题
数据库·python·pycharm·beautifulsoup·bug·pandas·pip
狐狸1174 天前
解决在win10找不到site-packages\torch\lib\shm.dll“ or one of its dependencies 问题
pytorch·conda·pip
封奚泽优4 天前
Deep-Live-Cam(调试和求助)
git·python·ffmpeg·pip·cuda
智算菩萨6 天前
Pip与第三方库:一行命令安装 AI 能力
人工智能·pip
Misnice6 天前
pip 查看当前包列表
windows·python·pip
万粉变现经纪人8 天前
如何解决 pip install 代理报错 407 Proxy Authentication Required 问题
windows·python·pycharm·beautifulsoup·bug·pandas·pip
将心ONE8 天前
pip导出项目依赖
开发语言·python·pip
垦***耪9 天前
对比分析:PWM整流器的不平衡电网下ADRC与PI控制,及顺序模型预测控制(S-MPC)的m函数实现
pip