pip设置镜像源极速下载

由于不能说的原因,安装部分包时经常断掉,或者非常缓慢,在没有科学上网的条件下,选择镜像就是非常靠谱的办法

临时使用

  • 阿里的镜像

pip install -i https://mirrors.aliyun.com/py… some-package

  • 清华的镜像(推荐教育网使用)

pip install -i https://pypi.tuna.tsinghua.ed… some-package

注意,simple 不能少, 是 https 而不是 http

全局设置

设为默认

pip config set global.index-url https://mirrors.aliyun.com/py…

或修改对应的文件~/.pip/pip.conf%HOMEPATH%\pip\pip.ini

 [global]
 trusted-host =  mirrors.aliyun.com
 index-url = https://mirrors.aliyun.com/pypi/simple

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理