I had the same problem. Previously I had anaconda 2 but I removed to install anaconda 3. After installing anaconda 3 and using conda init I got the same error message, as I solved it. Enter your .bashrc:
gedit ~/.bashrc
Identify the following lines in the .bashrc file and delete them:
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup = "$ ('/ home / spidey / anaconda3 / bin / conda' 'shell.bash'
'hook' 2> / dev / null)"
if [$? -eq 0]; then
eval "$ __ conda_setup"
else
if [-f "/home/spidey/anaconda3/etc/profile.d/conda.sh"]; then
. "/home/spidey/anaconda3/etc/profile.d/conda.sh"
else
export PATH = "/ home / spidey / anaconda3 / bin: $ PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
Explanation: Since previously you already had an anaconda installation, the conda init command did not modify anything because it detected that you had already made changes to the .bashrc file.
As far as I understand this, conda init [shell] is used to initiate a specific shell utilized when executing command-line conda commands. Not specifying one will default it to bash, which I'm guessing is what you already use here—since this is the output.
More information can be found by using the [-h] flag:
as it states here (from /opt/conda/bin/conda init -h )
positional arguments: shells One or more shells to be
initialized. If not given, the default value is 'bash' on unix and
'cmd.exe' on Windows. Use the '--all' flag to initialize
all shells. Currently compatible shells are {bash, fish, powershell, tcsh, xonsh, zsh}
This is weird because I did not have this problem before while setting up another server. But anyway it is clear that you need to specify the shell (which is zsh here), otherwise conda will pick up bash as default shell.
While this does not try to fix this problem, rather helps as a workaround when I want to activate an env.
I had the same problem. Previously I had anaconda 2 but I removed to install anaconda 3. After installing anaconda 3 and using conda init I got the same error message, as I solved it. Enter your
.bashrc
:Identify the following lines in the
.bashrc
file and delete them:Explanation:
Since previously you already had an anaconda installation, the conda
init command
did not modify anything because it detected that you had already made changes to the.bashrc
file.Try By Using anaconda-navigator:
activate conda:
Launch conda:
If you want to launch JupyterNotebook simply run
As far as I understand this,
conda init [shell]
is used to initiate a specific shell utilized when executing command-lineconda
commands. Not specifying one will default it to bash, which I'm guessing is what you already use here—since this is the output.More information can be found by using the
[-h]
flag:Use this instead:
I found the solution
/opt/conda/bin/conda init zsh
as it states here (from
/opt/conda/bin/conda init -h
)This is weird because I did not have this problem before while setting up another server. But anyway it is clear that you need to specify the
shell
(which iszsh
here), otherwiseconda
will pick upbash
as default shell.source ~/.bashrc
orsource ~/.bash_profile
should work