I would like to change the base install environment that initiates when I start a terminal to a different environment that I have created called myenv anaconda environment.

I want myenv to start every time I start the terminal.

I have turned off the base environment from initiating.

conda config --set auto_activate_base false

I am on Ubuntu 20.04.

In my .bashrc file I already have a conda init at the end. I am not sure if I should anything with it.

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/MYUSERNAME/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/nul>
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
    if [ -f "/home/MYUSERNAME/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/home/MYUSERNAME/anaconda3/etc/profile.d/conda.sh"
        export PATH="/home/MYUSERNAME/anaconda3/bin:$PATH"
unset __conda_setup
# <<< conda initialize <<<
  • Would conda activate myenv in your ~/.bashrc work for you?
    – Ray
    May 31, 2021 at 7:09

1 Answer 1


All you have to do is edit your ~/.bashrc file and add the following line at the end of it:

conda activate myenv

You can also add it using this command:

echo "conda activate myenv" >> ~/.bashrc

Don't comment out or remove the conda initialization block. Just put the conda command at the end of your .bashrc.

The content of ~/.bashrc is run every time you start a terminal, so adding the conda command activates your myenv environment when opening a new terminal.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .