I’m a novice with Anaconda. The other day I think I was trying to tidy up my files and may have inadvertently moved the Anaconda 3 folder to a new location. Now Anaconda won’t launch at all and even the icon’s gone in the application list. I was going to uninstall the whole program following the uninstall instructions. but when I try to run conda install anaconda-clean in terminal
I get an error message saying zsh: command not found: conda. I don’t want to make a further mistake from here and don’t understand bash and zsh. To get Anaconda working again, perhaps it’s just a case of having the Anaconda 3 folder moved back to the right folder location and everything will work again?.. Any advice on what to do for the best gratefully received. Sorry to ask such a basic question… I’m happy with either a working Anaconda installed or with an uninstall, but I can’t run it or delete it at the moment.
dear David.
Thank you for your contribution to the anaconda community. ,
First of all, without rushing, let’s check the contents of the folder in the hard disk of your PC.
There are several possible patterns, so it’s difficult to answer one by one, but here are some common patterns:
- Deleted.
In this case it’s easy, just remove the anacoda startup script in zsh or bash. Then install it again and it will be back.
2.It has moved.
In this case, it will be troublesome, but please try the following method. In addition, bash is used as the base.
>>> conda initialize >>>
!! Contents within this block are managed by ‘conda init’ !!
__conda_setup=“$(‘/xxx/yyy/anaconda3/bin/conda’ ‘shell.bash’ ‘hook’ 2> /dev/null)”
if [ $? -eq 0 ]; then
eval “$__conda_setup”
else
if [ -f “/xxx/yyy/anaconda3/etc/profile.d/conda.sh” ]; then
. “/xxx/yyy/anaconda3/etc/profile.d/conda.sh”
else
export PATH=“/xxxx/yyy/anaconda3/bin:$PATH”
fi
fi
unset __conda_setup
The above is a quote from bash.rc, but after changing /xxx/yyy to the destination directory and restarting the shell, the conda command should work.
Regards, you.
Dear Tanaka,
Thank you for your reply and assistance.
Here’s a little further information in case it helps.
I still have an Anaconda 3 folder which contains lots of subfolders and the app file itself (which doesn’t open regardless of where I seen to put it). I wonder where this Anaconda 3 folder should be located on my Mac. This folder is currently in my applications folder, but perhaps that’s the wrong place for it. I can’t remember where it was before I stupidly moved it from elsewhere.
I opened the .bash_profile by running open ~/.bash_profile in terminal and it comes up with another window containing text similar to what you posted re. Conda Initialise. Do I copy this code to the terminal window and run it? How do I then restart the shell as you suggest?
I’m really not understanding what detailed steps to take to resolve this and really don’t want to make matters worse. Very much out of my comfort zone with this.
I really appreciate your assistance.
Thanks and best wishes,
David
PS. When I run open ~/.bash_profile in terminal I get the following (with my ‘USERNAME’ replaced).
>>> conda initialize >>>
!! Contents within this block are managed by ‘conda init’ !!
__conda_setup=“$(‘/Users/USERNAME/opt/anaconda3/bin/conda’ ‘shell.zsh’ ‘hook’ 2> /dev/null)”
if [ $? -eq 0 ]; then
eval “$__conda_setup”
else
if [ -f “/Users/USERNAME/opt/anaconda3/etc/profile.d/conda.sh” ]; then
. “/Users/USERNAME/opt/anaconda3/etc/profile.d/conda.sh”
else
export PATH=“/Users/USERNAME/opt/anaconda3/bin:$PATH”
fi
fi
unset __conda_setup
<<< conda initialize <<<
The current location of my Anaconda 3 folder isn’t in the opt folder but elsewhere. I looked up how to view the local opt folder, opening finder and typing /usr/local/opt in the dialogue after pressing command+shift+G, but this didn’t show anything. From the above code, would you expect there to be an opt folder within my user area which should contain the extensive Anaconda 3 folder? Hope this makes some sense to you.
Try uninstalling Anaconda Manually. For this, you’ll need to get to the Library folder and find all support files related to Anaconda. Also, I recommend using a third-party application like App Cleaner & Uninstaller to completely delete Anaconda and then perform a clean installation. By the link, you can find all the steps for a manual removal of Anaconda.