【发布时间】:2021-11-11 16:04:54
【问题描述】:
由于某种原因,我的 VM 上的 jupyter 笔记本处于错误的环境中(即卡在 (base) 中)。此外,我可以在终端中更改环境,但不能在笔记本中更改。这是我在笔记本中尝试!conda activate desired_env 时发生的情况:
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'.
# conda environments:
#
base * /anaconda
azureml_py36 /anaconda/envs/azureml_py36
azureml_py38 /anaconda/envs/azureml_py38
azureml_py38_pytorch /anaconda/envs/azureml_py38_pytorch
azureml_py38_tensorflow /anaconda/envs/azureml_py38_tensorflow
我尝试了here 的答案(例如,首先运行!source /anaconda/etc/profile.d/conda.sh)。
我还尝试使用source 而不是“conda activate”来激活环境:!source /anaconda/envs/desired_env/bin/activate。当我在conda env list 中看到当前环境时,它会运行但实际上并没有做任何事情
编辑:还补充说,如果我在终端的(base) 环境中安装一个包,我仍然无法在 jupyter notebook 中访问它。
【问题讨论】:
标签: azure jupyter-notebook virtual-machine conda azure-machine-learning-studio