报错: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,运行结束后重启终端应该就能解决

目录
相关文章
|
Shell Linux
解决脚本文件无法执行conda命令的问题:CommandNotFoundError: Your shell has not been properly configured to use
使用Linux系统时,有时候希望利用一个脚本执行多条命令来节省时间,其中如果安装有anaconda,需要切换环境或者关闭conda环境,按道理说,在终端里可以通过命令
1962 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‘.简单解决方案
2314 0
CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.简单解决方案
|
Ubuntu Shell Python
在ubuntu16.04中输入不存在shell命令时,报错ModuleNotFoundError的解决方案
在ubuntu16.04中输入不存在shell命令时,报错ModuleNotFoundError的解决方案
671 0
|
Shell Linux Windows
Linux shell 执行报错 字符编码转换 iconv/dos2unix 将 gbk/gb2312 转utf8 解决方案
功能: 1. 解决字符转换,字符乱码。2.解决执行报错 ^M 。 sudo dos2unix $file # 非常重要:解决 windows 和 ubuntu下的 ^M 字符错误, shell 执行报错 ^M ; 这个符号是 windows 的换行符号
633 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‘.
499 0
|
Shell Linux
全网首发:MAC上运行SHELL脚本,typeset -l报错
全网首发:MAC上运行SHELL脚本,typeset -l报错
195 0
|
7月前
|
关系型数据库 MySQL Shell
MySQL 备份 Shell 脚本:支持远程同步与阿里云 OSS 备份
一款自动化 MySQL 备份 Shell 脚本,支持本地存储、远程服务器同步(SSH+rsync)、阿里云 OSS 备份,并自动清理过期备份。适用于数据库管理员和开发者,帮助确保数据安全。
|
5月前
|
存储 Unix Shell
确定Shell脚本在操作系统中的具体位置方法。
这对于掌握Linux的文件系统组织结构和路径方面的理解很有帮助,是我们日常工作和学习中都可能使用到的知识。以上讲解详细清晰,应用简便,是每一个想要精通操作系统的计算机爱好者必备的实用技能。
104 17
|
5月前
|
Linux Shell
Centos或Linux编写一键式Shell脚本删除用户、组指导手册
Centos或Linux编写一键式Shell脚本删除用户、组指导手册
126 4