更改pip国内镜像源

注意开启代理时无法通过国内镜像源获取包。

  1. Windows更改pip镜像源

    • 进入 C:\Users\Administrator\AppData\Roaming 路径下

    • 找到pip文件夹,更改其中的pip.ini文件。如果没有文件夹则新建同名文件夹和同名配置文件。

      [global]
      timeout = 6000
      index-url = https://pypi.tuna.tsinghua.edu.cn/simple
      trusted-host = https://pypi.tuna.tsinghua.edu.cn/simple
      
  2. 更改pip源

    • 在用户的家目录下创建名为.pip文件夹

    • 在.pip文件夹中创建名为pip.conf的文件

    • pip.conf文件中输入以下内容

      [global]
      timeout = 6000
      index-url = https://pypi.tuna.tsinghua.edu.cn/simple
      trusted-host = https://pypi.tuna.tsinghua.edu.cn/simple
      
  3. 镜像源

posted @ 2021-10-14 10:19  二细  阅读(178)  评论(0)    收藏  举报