conda pip安装在哪里_Conda及Pip换源处理

Pip 换源

在 user home 目录下新建一个 ~/.pip/pip.config 文件,添加如下配置:

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

如果想要临时更换 pip 源,则可以在相应的 pip 命令调用时,在命令的最后加上:

-i https://pypi.tuna.tsinghua.edu.cn/simple

Conda 换源

在 user home 目录下新建一个 .condarc 文件,添加如下配置:

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
  - default
ssl_verify: true
show_channel_urls: true

Pytorch 包 Conda 下载缓慢的解决办法

Pytorch 下载缓慢的原始是因为在 conda 下载时调用的源较差,Pytorch 的整个安装耗时主要是在 cudatoolkit 和 Pytorch 安装包上了,如果可以在网络环境较好的 conda 源中找到这两个包,就能解决速度慢的问题。

打开 Pytorch 官网,给出的 Linux 版本的安装命令如下:

60c2faf9cb06302af882e09f15d2b3aa.png
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch

我们只需要去掉该命令最后的 -c pytorch,这样在安装的时候就会默认调用用户在系统中设定的默认镜像源:

conda install pytorch torchvision cudatoolkit=10.1

f57f592c199b447139c4ef445bf31e22.png

参考资料:

  • conda安装Pytorch下载过慢解决办法(11月26日更新ubuntu下pytorch1.3安装方法)_watermelon1123的博客-CSDN博客_conda安装pytorch
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值