Ubuntu Anaconda3相关问题
- 1 conda:为找到命令
 - 2 CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
 
1 conda:为找到命令
1.1 问题
在Ubuntu系统下,安装anaconda3后,首次在终端输入:conda create -n yolo python=3.9或conda --version,结果是conda:为找到命令。
1.2 解决方法
1) sudo gedit ~/.bashrc 打开bashrc文件;
 2) 在anaconda3的bin目录下打开终端,输出pwd查看路径,如:/home/aliya/anaconda3/bin
 3) 在 bashrc 文件的最后一行写入export PATH="/home/用户名/anaconda3/bin:$PATH",如:export PATH="/home/aliya/anaconda3/bin:$PATH"
 4) 保存并关闭bashrc文件
 5) 在终端中输入conda --version则可以正常显示conda的版本。
2 CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate’.
2.1 问题
打开终端时,并没有进入conda(base)环境,直接输入conda activate -n yolo python=3.9会报错:
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'.
 
2.2 解决方法
先输入source activate,进入base环境,随后即可进行其他操作。
 注:在Windows系统下,输入activate可以进入base环境,但Ubuntu不同。









