报错:CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘. 问题解决

简介: 报错:CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘. 问题解决

今天在VS code里跑一个小网络,想先切换conda环境,发现无法切换了,并提示报错为:

PS E:\XXX> conda activate XXXXX
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If using 'conda activate' from a batch script, change your
invocation to 'CALL conda.bat activate'.
To initialize your shell, run
    $ conda init <SHELL_NAME>
Currently supported shells are:
  - bash
  - cmd.exe
  - 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'.


查了下原因,大概意思是初次使用Anaconda时,没有预先对命令行进行预载。解决办法非常简单,在上文报错的提示中也说明了,根据提示运行对应的命令即可

conda init {TERMINAL_TYPE}


即,在windows下,终端中输入

conda init cmd.exe


在linux下,终端中输入

conda init bash


在VScode中,我使用了powershell,运行结束后重启终端应该就能解决

目录
相关文章
|
8月前
|
Shell Linux
解决脚本文件无法执行conda命令的问题:CommandNotFoundError: Your shell has not been properly configured to use
使用Linux系统时,有时候希望利用一个脚本执行多条命令来节省时间,其中如果安装有anaconda,需要切换环境或者关闭conda环境,按道理说,在终端里可以通过命令
457 0
|
Shell Windows
[记录condaのbug] CommandNotFoundError: Your shell has not been properly configured to use ‘conda...
[记录condaのbug] CommandNotFoundError: Your shell has not been properly configured to use ‘conda...
[记录condaのbug] CommandNotFoundError: Your shell has not been properly configured to use ‘conda...
|
Shell
【已解决】CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.
【已解决】CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.
307 0
|
Shell
CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.简单解决方案
CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.简单解决方案
1607 0
CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.简单解决方案
|
7天前
|
Java 关系型数据库 MySQL
Elasticsearch【问题记录 01】启动服务&停止服务的2类方法【及 java.nio.file.AccessDeniedException: xx/pid 问题解决】(含shell脚本文件)
【4月更文挑战第12天】Elasticsearch【问题记录 01】启动服务&停止服务的2类方法【及 java.nio.file.AccessDeniedException: xx/pid 问题解决】(含shell脚本文件)
35 3
|
2天前
|
弹性计算 运维 Shell
每天解析一个shell脚本(61)
【4月更文挑战第26天】shell脚本解析及训练(61)
14 3
|
2天前
|
弹性计算 运维 Shell
每天解析一个shell脚本(58)
【4月更文挑战第26天】shell脚本解析及训练(58)
68 0
|
2天前
|
弹性计算 Shell 数据安全/隐私保护
每天解析一个shell脚本(56)
【4月更文挑战第26天】shell脚本解析及训练(56)
14 0
|
4天前
|
监控 Shell 应用服务中间件
第十二章 Shell脚本编写及常见面试题(二)
第十二章 Shell脚本编写及常见面试题(二)