在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

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

相关推荐

  1. Ubuntu conda创建环境失败报错相关问题

    2024-04-02 13:08:01       40 阅读
  2. 如何conda创建查询删除虚拟环境

    2024-04-02 13:08:01       48 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-02 13:08:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-02 13:08:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-04-02 13:08:01       82 阅读
  4. Python语言-面向对象

    2024-04-02 13:08:01       91 阅读

热门阅读

  1. mysql常见故障及mysql优化

    2024-04-02 13:08:01       44 阅读
  2. python之匿名函数

    2024-04-02 13:08:01       34 阅读
  3. 钉钉“牵手”微信,互联网“拆墙”大步迈进

    2024-04-02 13:08:01       34 阅读
  4. 技术与安全的交织

    2024-04-02 13:08:01       31 阅读
  5. mysql定时任务

    2024-04-02 13:08:01       36 阅读
  6. 递归解决图的深度遍历

    2024-04-02 13:08:01       37 阅读
  7. UDP端口连不上的情况

    2024-04-02 13:08:01       35 阅读
  8. Mybatis——SqlSession的工作流程

    2024-04-02 13:08:01       33 阅读
  9. 数据类型与变量

    2024-04-02 13:08:01       37 阅读