96 字
1 分钟
Python pip切换镜像源

临时换源#

请将package_name替换为需要安装的包的名字

  • 清华源

    • pip install package_name -i https://pypi.tuna.tsinghua.edu.cn/simple
  • 阿里源

    • pip install package_name -i https://mirrors.aliyun.com/pypi/simple/
  • 腾讯源

    • pip install package_name -i http://mirrors.cloud.tencent.com/pypi/simple
  • 豆瓣源

    • pip install package_name -i http://pypi.douban.com/simple/

永久换源#

  • 清华源

    • pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
  • 阿里源

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

    • pip config set global.index-url http://mirrors.cloud.tencent.com/pypi/simple
  • 豆瓣源

    • pip config set global.index-url http://pypi.douban.com/simple/

换回默认源#

  • pip config unset global.index-url
Python pip切换镜像源
https://blog.kimbleex.top/posts/2020-05-03-python-switch-source/
作者
Kimbleex
发布于
2020-05-03
许可协议
CC BY-NC-SA 4.0