在linux下conda 创建虚拟环境失败的解决方法

报错内容一:

Solving environment: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/conda-forge/noarch/repodata.json\>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'conda.anaconda.org\', port=443): Max retries exceeded with url: /conda-forge/noarch/repodata.json (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_certificate\', \'certificate verify failed\')])")))'))

解决方法:

切记看好自己的系统是windows还是linux。网上很多方法均是添加镜像源,但是windows和linux是不相同的,不可以直接按照网上增加镜像源。

1)vim ~/.condarc

2)通过i 进入vim编辑模式,添加如下内容:

复制代码
channels:
  - defaults
show_channel_urls: true
default_channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

3)通过 ESC + :wq保存退出

4)重新创建环境 conda create -n xxx python=3.9

报错内容二:

To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.

解决方法:只需要在下包之前输入如下命令就可以了

复制代码
 conda config --add channels conda-forge

执行后执行对应包的安装即可。

相关推荐
不爱缺氧i6 分钟前
ubuntu离线安装mariadb
linux·ubuntu·mariadb
疯狂敲代码的老刘18 分钟前
JDK 1.6到25 全版本网盘合集 (Windows + Mac + Linux)
java·linux·windows·macos·jdk
爆米花byh22 分钟前
在RockyLinux9环境的Storm2.8.3单机版安装
linux·中间件·storm
纤纡.23 分钟前
Linux 下 MySQL 数据类型与约束:第三章核心表格归纳与实战应用
linux·mysql
陈桴浮海31 分钟前
【Linux&Ansible】学习笔记合集三
linux·运维·云原生·ansible
yuanmenghao43 分钟前
Linux 性能实战 | 第 10 篇 CPU 缓存与内存访问延迟
linux·服务器·缓存·性能优化·自动驾驶·unix
EnglishJun1 小时前
Linux系统编程(二)---学习Linux系统函数
linux·运维·学习
VekiSon1 小时前
Linux内核驱动——设备树原理与应用
linux·c语言·arm开发·嵌入式硬件
Trouvaille ~1 小时前
【Linux】进程间关系与守护进程详解:从进程组到作业控制到守护进程实现
linux·c++·操作系统·守护进程·作业·会话·进程组
Fcy6481 小时前
Linux下 进程(二)(进程状态、僵尸进程和孤儿进程)
linux·运维·服务器·僵尸进程·孤儿进程·进程状态