欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.

程序员文章站 2022-06-01 19:46:39
...

文章目录

问题

创建了一个新环境openne,退出mac终端后,再重新打开终端,想登陆新环境,出现错误提示。

Last login: Sat Jul 18 17:49:44 on ttys001
[email protected] ~ % conda activate openne

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'.

原因

必须先进入默认环境,再退出,再操作。

解决方案

先进入默认环境base,退出默认环境,再进入自定义环境openne。

[email protected] ~ % source activate
(base) [email protected] ~ % conda deactivate
[email protected] ~ % conda activate openne
(openne) [email protected]~ % 

在此基础上,再切换至另一个自定义环境 embedding,就不需要重新进入默认环境 base 了,退出当前环境 openne,直接用 conda activate embedding 即可。

(openne) [email protected] ~ % conda deactivate
[email protected] ~ % conda activate embedding
(embedding) [email protected] ~ % 
相关标签: 问题