前言
在安装完Anaconda之后,打开Anaconda Prompt,若出现”(base)”说明Anaconda安装成功。 具体Anaconda的安装后续会出教程
在创建环境之前,要先添加国内镜像源,否则会出现”Solving environment: failed”的报错,针对此问题主要有三种解决办法:(这里笔者用的Win10专业版环境)
1.在命令行窗口中,用命令语句添加国内源(选清华源或中科大源)
清华源
conda config --add channels https:
conda config --add channels https:
conda config --add channels https:
conda config --set show_channel_urls yes # 设置搜索时显示通道地址
中科大源
conda config --add channels https:
conda config --add channels https:
conda config --add channels https:
conda config --add channels https:
conda config --add channels https:
conda config --add channels https:
conda config --set show_channel_urls yes
其它相关的命令
conda config --remove-key channels 换回conda默认源,在出现一些故障时可以使用
conda config --show-sources 找到.condac文件并查看里面的镜像源
2.在C盘的C:\Users\adminstrtor中找到.condarc文件(若没有这个文件就新建一个,注意文件名为.condarc,不要有任何其他后缀)(本人是用这种方法)
在.condarc文件中输入以下内容:(以清华镜像源为例)
show_channel_urls: true
channel_alias: http:
default_channels:
- http:
- http:
- http:
- http:
- http:
custom_channels:
conda-forge: http:
msys2: http:
bioconda: http:
menpo: http:
pytorch: http:
simpleitk: http:
channels:
- defaults
ssl_verify: true
这个方法能解决”创建一个新环境都报错’Solving environment: failed’,已经添加了清华源,还是报错”的问题。
Tip:文件中镜像源中http而不是https 否则容易出错
http:
http:
https:
http:
由于每个人碰到的问题可能有所差别,以及笔者可能有所疏忽,所以本篇文章的方法对每个人并不一定奏效,有什么问题可以在评论区里留言,笔者能解决一定帮忙解决。当然,笔者也会对其中的疏忽进行补充、不定时更新,在记录自己学习过程中碰到的问题的同时,也希望能给其他网友提供一定的帮助,让碰到相同问题的网友能少走弯路,把更多的时间花在编程和知识学习上。
参考:https://www.cnblogs.com/johnyang/p/13417374.html
Original: https://blog.csdn.net/m0_46673202/article/details/125013021
Author: 六子666
Title: conda创建环境过程中出现“Solving environment: failed”报错的解决办法
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/605521/
转载文章受原作者版权保护。转载请注明原作者出处!