指定pip源

在服务器上新建了虚拟环境,使用pip安装软件时,速度比较慢,可以通过换源的方式,加快速度。

  1. 在/home/user/目录下新建.pip文件夹,里面新建pip.conf文件:
cd ~
mkdir .pip
vim .pip/pip.conf
  1. 在pip.conf文件中输入以下内容:
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

保存退出即可,再使用pip install命令时,速度会很快。



作者:郅朋
链接:https://www.jianshu.com/p/3dbc13b90864
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
posted @ 2020-03-17 10:42  番茄土豆西红柿  阅读(602)  评论(0编辑  收藏  举报
TOP