pip修改成国内镜像源

  • 临时指定镜像源
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple seaborn
  • 永久修改镜像源

linux下,修改 ~/.pip/pip.conf (没有就创建一个), 修改 index-url至tuna,内容如下:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install] trusted-host=pypi.tuna.tsinghua.edu.cn
disable-pip-version-check = true
timeout = 6000

windows下,直接在user目录中创建一个pip目录,如:C:\Users\xx\pip,新建文件pip.ini,内容如下

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=pypi.tuna.tsinghua.edu.cn
disable-pip-version-check = true
timeout = 6000
  • 常用的镜像源
#豆瓣
https://pypi.douban.com/simple/
#清华
https://pypi.tuna.tsinghua.edu.cn/simple

猜你喜欢

转载自www.cnblogs.com/raisok/p/11636039.html
今日推荐