Skip to content Skip to sidebar Skip to footer

Conda Command Not Available In Conda Environment Per Default

Why I cannot update conda from a conda environment, but I can use it? An example I can update conda from root [ravas@localhost ~]$ source activate (base) [ravas@localhost ~]$ conda

Solution 1:

This is a consequence of how the shell (Bash, zsh, csh, fish, etc.) finds programs to execute. (The shell is the program that is running to process the commands you type in the terminal). The shell looks for executables in folders that are specified in the PATH environment variable. It searches these folders in the order that they're specified in that variable. If you look at the contents of the PATH with your environment activated, it should look something like

$ echo$PATH
/home/ravas/miniconda3/envs/p36/bin:/home/ravas/miniconda3/bin:...

When the shell tries to find the conda executable, it looks first in the environment directory; when it doesn't find it there, it looks in the base directory, where it does find it!

Solution 2:

conda is not installed in the new environment. But you can get a conda in that derived environment like this:

  • activate the base environment
  • activate your other environment
  • run a conda install conda

Now you have a conda in that other environment, and work with that environment as usually.

Post a Comment for "Conda Command Not Available In Conda Environment Per Default"