0

As the following picture shows, my default Anaconda environment(anaconda3)have no name.

What's more, I'd love to set the Anaconda3 as my default python environment.

I also find this in my ~/.bashrc document.

# added by Anaconda3 4.4.0 installer
export PATH="/home/cine/anaconda3/bin:$PATH"

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/cine/anaconda2/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/cine/anaconda2/etc/profile.d/conda.sh" ]; then
        . "/home/cine/anaconda2/etc/profile.d/conda.sh"
    else
        export PATH="/home/cine/anaconda2/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

How to do ?

Hong Cheng
  • 318
  • 1
  • 4
  • 19
  • You installed both Anaconda 2 and 3? That is not recommended. – merv Dec 04 '19 at 20:56
  • 1
    Oh, Really? But how can I do the switch between the Python2 and python3 – Hong Cheng Dec 06 '19 at 02:37
  • That's what Conda is for: https://stackoverflow.com/questions/24405561/how-to-install-2-anacondas-python-2-and-3-on-mac-os – merv Dec 06 '19 at 16:25
  • Possible duplicate of [How to install 2 Anacondas (Python 2 and 3) on Mac OS](https://stackoverflow.com/questions/24405561/how-to-install-2-anacondas-python-2-and-3-on-mac-os) – merv Dec 07 '19 at 16:27

1 Answers1

2

you have to include PATH variable in the default .rc file. An easy fix is just to add

export PATH="/home/username/anaconda3/bin:$PATH"

to your ~/.profile file. Then source the file by running

source ~/.profile

in a terminal.

Verify that it works by running

which python

You should see /home/username/anaconda3/bin/python

Saqib Naseeb
  • 731
  • 1
  • 9
  • 21
  • Please see that figure, we have two environment name: base and py27_ENAS, but there is no name for third environment. And I have added my ~/.bashrc document for your consideration. Thanks a lot – Hong Cheng Dec 04 '19 at 06:51
  • Actually, you method works. But there is still a “(base)” on the terminal. do you know have to remove it ? Thanks a lot – Hong Cheng Dec 04 '19 at 06:58
  • well its tricky because you don't have env name in the first place, but if you had then you could rename it, conda `create --name new_name --clone old_name` `conda remove --name old_name --all` **or its alias:** `conda env remove --name old_name` – Saqib Naseeb Dec 04 '19 at 07:12
  • 1
    you are right. I also find this. It looks that there is no way to add a name to the default env. I will wait several days – Hong Cheng Dec 06 '19 at 02:39