pip 修改默认镜像源


方法

临时方法

pip install pythonModuleName -i https://pypi.douban.com/simple

永久修改

方式1

修改~/.pip/pip.conf:
[global]
index-url = https://pypi.douban.com/simple
# [install]
# use-mirrors = true
# mirrors = https://mirrors.aliyun.com/pypi/simple/
# trusted-host = mirrors.aliyun.com

方式2

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

常用源

  1. https://pypi.tuna.tsinghua.edu.cn/simple/
  2. https://mirrors.aliyun.com/pypi/simple/
  3. https://pypi.douban.com/simple/