Windows下更换pip源为清华源

Windows下更换pip源为清华源

  1. 打开appdata文件夹,在资源管理器的地址栏输入%appdata%后回车:
    在这里插入图片描述

  2. 新建一个pip文件夹,在pip文件夹里面新建一个配置文件pip.ini:
    Windows下更换pip源为清华源_第1张图片

  3. 在配置文件中输入如下内容后保存即可:

    [global]
    time-out=60
    index-url=https://pypi.tuna.tsinghua.edu.cn/simple/
    [install]
    trusted-host=tsinghua.edu.cn
    
  4. 再次使用pip,即会使用新源。

这里顺带提一下国内的其他镜像源:

  • 清华:https://pypi.tuna.tsinghua.edu.cn/simple
  • 阿里云:http://mirrors.aliyun.com/pypi/simple/
  • 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
  • 华中理工大学:http://pypi.hustunique.com/
  • 山东理工大学:http://pypi.sdutlinux.org/
  • 豆瓣:http://pypi.douban.com/simple/

OK,如果大家喜欢我的文章可以收藏支持!

你可能感兴趣的:(Python,windows,python)