在服务器上新建了虚拟环境,使用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
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

相关文章:

  • 2022-12-23
  • 2022-03-01
  • 2021-07-28
  • 2021-10-22
  • 2021-06-06
  • 2022-12-23
猜你喜欢
  • 2021-07-22
  • 2022-03-06
  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2022-01-21
相关资源
相似解决方案