CommandNotFoundError: Your shell has not been properly configured to use #39;conda activate#39;(CommandNotFoundError:您的shell尚未正确配置为使用Conda Activate#39;)
                            本文介绍了CommandNotFoundError:您的shell尚未正确配置为使用Conda Activate';的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
                        
                        问题描述
我正在尝试使用Google Colboratory上的Conda创建虚拟环境。 但是,我无法激活,出现以下错误。
    CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run
    $ conda init <SHELL_NAME>
Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell
See 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init
我尝试过两个改进。 我尝试过三种改进。 一种是将以下代码添加到~/.bashrc。
# >>> conda init >>>
__conda_setup="$(CONDA_REPORT_ERRORS=false '$HOME/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "$HOME/anaconda3/etc/profile.d/conda.sh" ]; then
        . "$HOME/anaconda3/etc/profile.d/conda.sh"
        CONDA_CHANGEPS1=false conda activate base
    else
        export PATH="$PATH:$HOME/anaconda3/bin"
    fi
fi
unset __conda_setup
# <<< conda init <<<
# ~~~~~~~~~~~~
conda create --name XXXXXX python=3.6 -y
conda activate XXXXXX 
# ~~~~~~~~~~~~
其次,我将以下代码添加到~/.bashrc
export PATH="$PYENV_ROOT/versions/anaconda3-2.5.0/bin/:$PATH"
第三,我将以下代码添加到~/.bashrc
. /opt/anaconda3/etc/profile.d/conda.sh
conda activate base
如果我尝试激活它们中的每一个,都会收到相同的错误。如果有人理解,请分享您的智慧。
谢谢
推荐答案
答案如下: https://github.com/conda/conda/issues/7980
source ~/anaconda3/etc/profile.d/conda.sh
conda activate my_env
可能您也使用了错误的anaconda/miniconda路径。 使用此命令产生的命令:
conda info | grep -i 'base environment'
:)
这篇关于CommandNotFoundError:您的shell尚未正确配置为使用Conda Activate';的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
				 沃梦达教程
				
			本文标题为:CommandNotFoundError:您的shell尚未正确配置为使用Conda Activate';
				
        
 
            
        基础教程推荐
             猜你喜欢
        
	     - 包装空间模型 2022-01-01
 - PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
 - 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
 - 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
 - 修改列表中的数据帧不起作用 2022-01-01
 - 在Python中从Azure BLOB存储中读取文件 2022-01-01
 - 求两个直方图的卷积 2022-01-01
 - Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
 - PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
 - 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
 
    	
    	
    	
    	
    	
    	
    	
    	
				
				
				
				