我的 Conda 在 ubuntu 终端上运行良好。我可以使用以下命令轻松激活我需要的环境
$ conda activate base
并在终端上加载基本环境。
但是在这里,在 MATLAB 中,当我尝试使用以下命令激活 conda 环境时,它返回错误
>> system('conda activate base')
/bin/bash: conda: command not found
基于 other posts 的类似讨论,我尝试了以下但没有运气
>> system('/home/anirudha/anaconda3/bin/conda activate base')
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'.
>> system('conda init bash');
/bin/bash: conda: command not found
我也尝试过 this 的解决方案,但都没有成功。
我的目的是通过 MATLAB 脚本从命令行执行一些 gdal 函数。我曾尝试在我的 Windows PC 上执行此操作,并且一切正常。但不是在我的 Linux 站上。我错过了什么吗?