创建anaconda虚拟环境的时候报错UnavailableInvalidChannel: The channel is not accessible or is invalid.

本人在创建pytorch虚拟环境的时候出现了以下报错:

(base) root@rt-res-host1-57b8657bbc-kdsbx:~# conda create -n pytorch1.2 python=3.6
Collecting package metadata (current_repodata.json): failed

UnavailableInvalidChannel: The channel is not accessible or is invalid.
  channel name: acaconda/cloud/pytorch
  channel url: https://mirrors.tuna.tsinghua.edu.cn/acaconda/cloud/pytorch
  error code: 404

You will need to adjust your conda configuration to proceed.
Use `conda config --show channels` to view your configuration's current state,
and use `conda config --show-sources` to view config file locations.


怀疑是镜像的问题,查了一下果不其然,

使用下面的命令可以查看当前的,你已经输入的镜像源的网址

conda config --show channels

最终我使用下面的这句命令,恢复默认的镜像源即可解决:

conda config --remove-key channels

  • 4
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
在Ubuntu上配置AnacondaPyTorch环境,可以按照以下步骤进行操作: 1. 首先,打开终端并输入以下命令,以激活Anaconda环境配置文件: ``` source ~/anaconda3/etc/profile.d/conda.sh ``` 这样可以确保使用Anaconda的命令和环境。 2. 接下来,创建一个新的虚拟环境。可以使用以下命令创建一个名为"pytorch"的虚拟环境: ``` conda create -n pytorch ``` 按照提示操作,完成虚拟环境创建。 3. 安装PyTorch。可以使用以下命令安装PyTorch及其相关的软件包: ``` conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=11.0 -c pytorch ``` 这将安装PyTorch 1.7.1、torchvision 0.8.2 和 torchaudio 0.7.2,同需要指定使用的CUDA版本为11.0。通过 `-c pytorch` 参数,指定了从PyTorchAnaconda镜像源进行安装。 4. 如果你想加快PyTorch安装速度,可以更换Anaconda的镜像源。可以编辑Anaconda的配置文件,通过以下步骤更换为清华大学镜像源: - 打开终端,输入以下命令打开配置文件: ``` nano ~/.condarc ``` - 在编辑器中,找到 "channels" 部分,并删除其中的 "defaults" 镜像源。然后,将以下三个镜像源添加到配置文件中: ``` channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ show_channel_urls: true ``` - 保存并关闭文件。 5. 现在,重新运行PyTorch的conda安装命令,你应该能够感受到安装速度的明显提升: ``` conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=11.0 -c pytorch ``` 通过按照上述步骤进行操作,你就可以在Ubuntu上使用Anaconda配置PyTorch环境了。记得根据自己的需求和系统环境进行相应的调整。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [linux下使用anaconda配置pytorch环境](https://blog.csdn.net/Pythonistas29xs/article/details/126554676)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [ubuntu服务器安装anaconda并配置pytorch环境](https://blog.csdn.net/qq_44218195/article/details/122381668)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值