当前位置: 代码迷 >> 综合 >> Ubuntu 使用 conda activate 虚拟环境是报错:CommandNotFoundError: Your shell has not been properly configured t
  详细解决方案

Ubuntu 使用 conda activate 虚拟环境是报错:CommandNotFoundError: Your shell has not been properly configured t

热度:65   发布时间:2024-01-14 06:45:49.0

问题描述

  • 在 Ubuntu 下使用 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- powershellSee 'conda init --help' for more information and options.IMPORTANT: You may need to close and restart your shell after running 'conda init'.

解决方法

  • 首次使用 conda 虚拟环境时,先使用 source 代替 conda 打头激活虚拟环境
source activate 虚拟环境名称
  相关解决方案