Unable to activate environment conda - prompted to Run 'conda init' before 'conda activate' but it doesn't work

add
C:\Users\USER_NAME_HERE\AppData\Local\anaconda3\Scripts
to Path
=============================

In MacOS, i use conda init zsh,and i get the following message. It works!

$ conda init zsh
no change     /opt/anaconda3/condabin/conda
no change     /opt/anaconda3/bin/conda
no change     /opt/anaconda3/bin/conda-env
no change     /opt/anaconda3/bin/activate
no change     /opt/anaconda3/bin/deactivate
no change     /opt/anaconda3/etc/profile.d/conda.sh
no change     /opt/anaconda3/etc/fish/conf.d/conda.fish
no change     /opt/anaconda3/shell/condabin/Conda.psm1
no change     /opt/anaconda3/shell/condabin/conda-hook.ps1
no change     /opt/anaconda3/lib/python3.11/site-packages/xontrib/conda.xsh
no change     /opt/anaconda3/etc/profile.d/conda.csh
modified      /Users/acookie/.zshrc

==> For changes to take effect, close and re-open your current shell. <==
57

Alex Ackerman

First run:

source activate base # ( this would activate your conda base env )

and then

conda activate my_env # ( replace my_env with name of your new env )
12

conda init needs the shell name sometimes

If using zsh, run:

conda init zsh

Exit out of the shell, reopen and run:

conda activate test_env

See: Unable to activate environment - prompted to Run ‘conda init’ before ‘conda activate’ but it doesn’t work

6

In windows , You should change your security policy. First, run powershell using Administrator. Then,

Set-ExecutionPolicy RemoteSigned

Then, input Y

Then, reopen your powershell, then you can use:

conda activate your_env

留言

此網誌的熱門文章

Making a Windows 11 hotspot without an internet connection