0

My Conda working perfectly from the ubuntu terminal. I can easily activate the environment I need using the following command

$ conda activate base

and it loads the base environment on the terminal.

But here, in MATLAB, when I try to activate conda environment using the following command it returns an error

>> system('conda activate base')
/bin/bash: conda: command not found

Based on other posts with similar discussions, I have tried the following but to no luck

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

I have also tried solutions from this but to no success again.

My purpose is to execute a few gdal functions from the command line through a MATLAB script. I have tried doing this on my windows PC, and everything works perfectly. But not on my Linux station. Am I missing something?

avm
  • 1
  • 1
  • You last command is wrong, it shoudl be `system('/home/anirudha/anaconda3/bin/conda init bash')`, however note that I do not think that MATLAB command line is `bash`. – Ander Biguri Jun 04 '21 at 12:18
  • Thanks, Ander. This is the response that I get with the complete path `... no change /home/anirudha/anaconda3/etc/profile.d/conda.sh no change /home/anirudha/anaconda3/etc/fish/conf.d/conda.fish no change /home/anirudha/anaconda3/shell/condabin/Conda.psm1 no change /home/anirudha/anaconda3/shell/condabin/conda-hook.ps1 no change /home/anirudha/anaconda3/lib/python3.8/site-packages/xontrib/conda.xsh no change /home/anirudha/anaconda3/etc/profile.d/conda.csh no change /home/anirudha/.bashrc No action taken. `. I'm not sure about the Matlab shell either. – avm Jun 04 '21 at 12:34

0 Answers0