- Open your terminal.
- Run the command:
This command tell the terminal to source the
source /home/username/anaconda3/etc/profile.d/conda.sh
conda.sh
file in theetc/profile.d
directory of your Conda installation. Of note, replace/home/username/anaconda3
with your own path of conda. To get that, you can run:If the output iswhich conda
/home/username/anaconda3/bin/conda
, then the root path should be/home/username/anaconda3
. - Verify by activating an environment:
Replace
conda activate myenv
myenv
with the name of your environment. If the environment is activated successfully, then the issue is resolved.
If you want this setup to be persistent across all your terminal sessions, you can add the source
command to your shell's startup file (.bashrc
, .zshrc
, etc.):
echo "source /home/username/anaconda3/etc/profile.d/conda.sh" >> ~/.bashrc
This ensures that every time you open a new terminal, the Conda environment is set up automatically.