美文网首页
Virtualenv虚拟环境换源

Virtualenv虚拟环境换源

作者: P_Zhi | 来源:发表于2019-12-27 10:20 被阅读0次

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

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

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

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

相关文章

网友评论

      本文标题:Virtualenv虚拟环境换源

      本文链接:https://www.haomeiwen.com/subject/hgiroctx.html