conda: error: argument COMMAND: invalid choice

简介

使用conda activate 时,可能会报:conda: error: argument COMMAND: invalid choice: ‘activate’ (choose from ‘clean’, ‘compare’, ‘config’, ‘create’, ‘info’, ‘init’, ‘install’, ‘list’, ‘notices’, ‘package’, ‘remove’, ‘uninstall’, ‘rename’, ‘run’, ‘search’, ‘update’, ‘upgrade’, ‘content-trust’, ‘doctor’, ‘repoquery’, ‘env’)

解决方案

# 找到base env所在的路径
conda info
# 初始化conda
source <conda root path>/etc/profile.d/conda.sh

之后就可以用conda activate命令了。

如果你的环境有人安装了其他conda跟你的有冲突,可以在~/.bashrc中添加环境变量

export CONDA_ROOT=/xxx/conda
export CONDA_EXE=$CONDA_ROOT/bin/conda
export CONDA_PYTHON_EXE=$CONDA_ROOT/bin/python

export PATH=$CONDA_ROOT/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin/home/<your account>/.local/bin:/home/<your account>/bin

你可能感兴趣的:(#,环境问题,conda)