The reason why this happen is because Anaconda3 is installed under /
by default. While the new version of MacOS - Mac Catalina - won't allow that. So the whole folder has been moved to .../Relocated Items/Security/
.
All we have to do is moving them back with some little tricks in it:
Move the folder to ~
i.e. /Users/[your_user_name]
since it can't be moved back to root dir, i.e., /
. It's gonna take a while.
Open Terminal, go to /Users/[your_user_name]/anaconda3/bin/
.
Type vim conda
and press Enter. Change the first line from #!/anaconda3/bin/python
to #!/Users/[your_user_name]/anaconda3/bin/python
. Then save it and quit. (If you're not familiar with VIM, use any Editior you want.)
Type conda init zsh
and press Enter. (In my case it's zsh
, change to bash
, dash
or sh
due to your current environment.)
And you'll get this:
➜ ~ conda init zsh
modified /Users/[your_user_name]/anaconda3/condabin/conda
no change /Users/[your_user_name]/anaconda3/bin/conda
modified /Users/[your_user_name]/anaconda3/bin/conda-env
modified /Users/[your_user_name]/anaconda3/bin/activate
modified /Users/[your_user_name]/anaconda3/bin/deactivate
modified /Users/[your_user_name]/anaconda3/etc/profile.d/conda.sh
modified /Users/[your_user_name]/anaconda3/etc/fish/conf.d/conda.fish
no change /Users/[your_user_name]/anaconda3/shell/condabin/Conda.psm1
modified /Users/[your_user_name]/anaconda3/shell/condabin/conda-hook.ps1
modified /Users/[your_user_name]/anaconda3/lib/python3.6/site-packages/xontrib/conda.xsh
modified /Users/[your_user_name]/anaconda3/etc/profile.d/conda.csh
modified /Users/[your_user_name]/.zshrc
==> For changes to take effect, close and re-open your current shell. <==
➜ ~
Now you can use your whole anaconda3 environment in command line. (Don't forget to add the new home of anaconda3 to your shell init config file. In my case, it's to add export PATH=/Users/[your_user_name]/anaconda3/bin:$PATH
to ~/.zshrc
.)
The last step is to make your Anaconda-Navigator.app
work safe and sound.
Go to /Users/[your_user_name]/anaconda3/
, right click Anaconda-Navigator.app
and choose show package contents
or something like that.
Go on, find Contents/MacOS/run.sh
and open it with your favorite editor, change all the /anaconda3
to /Users/[your_user_name]/anaconda3
.
Finally, you can open your Anaconda-Navigator.app
as usual. (You might need a reboot to make it work.)
=================================
If you still get an error, we might use the last but not least weapon:
conda install -c anaconda anaconda-navigator
conda update update
This will check your current anaconda environment and find whatever it needs to repair. Considering we already have the nearly whole environment, it should only take a bit of download.
Done! Good luck!
1This fix is insufficient for many users. There are what appear to be thousands of files in my /anaconda3 directory (e.g. in /anaconda3/envs/) that point to /anaconda3/xyz that need to be edited to point to /Users/me/anaconda3. – Metropolis – 2019-10-09T20:19:06.960
did you mean
conda update conda
? – Yoav Vollansky – 2019-11-24T23:24:33.520