Anaconda Uninstaller Does Not Work Due to Pre_uninstaller
Moron alert: help me recover from dirty uninstall of Anaconda on Windows 10 (involves Git-Bash.exe)
I can't uninstall Anaconda3 in my system
Uninstalling Anaconda fails on Windows machine - Product Help - Anaconda Forum
Videos
[PROBABLY SOLVED NOW]
How I ended up here: I performed a dirty uninstallation of Anaconda last night and now I have something weird going on with Anaconda. I'm hoping you can help get me out of it.
Background: I'm running Windows 10 Pro x64. At one point I had an installation of Anaconda in C:\ProgramData\Anaconda3; I just uninstalled it using only uninstall-anaconda3.exe, which I later found out was dumb. I have reinstalled Anaconda to C:\Users\me\Anaconda3. None of my environment variables has or has ever had anything python-related or Anaconda-related in it. But I think I have some leftover things from that installation.
Specifics: A few things have happened which suggest that this is the case:
-
First, when I try to install Jupyter Notebook from Anaconda Navigator, I get the following:
EnvironmentLocationNotFound: Not a conda environment: C:\ProgramData\Anaconda3. -
Second, most importantly: I have Microsoft Git installed on my computer. Back when I had Anaconda installed to ProgramData, I did some stuff to cause git-bash.exe to start with my base Anaconda environment activated. (That stuff included adding a line to
C:\users\me\.bashrc. But I cleared out that .bashrc file right after uninstalling Anaconda3 from ProgramData). But now, it does not do that and instead causes me to get the following message:bash: /c/ProgramData/Anaconda3/Scripts/conda.exe: No such file or directory. -
The word "ProgramData" does not appear in any registry keys in any of the following locations:
-
HKEY_CURRENT_USER\Software\Python
-
HKEY_LOCAL_MACHINE\SOFTWARE\Python (this seems to have nothing interesting)
-
I don't have any other registry locations whose paths contain the word "Python."
-
Question: I would like to
-
make it so that git-bash starts with my base anaconda environment activated,
-
generally clean up junk from old Anaconda install,
-
find out what else to add to or remove from this question.
In the folder where you installed Anaconda (Example: C:\Users\username\Anaconda3) there should be an executable called Uninstall-Anaconda.exe. Double click on this file to start uninstall Anaconda.
That should do the trick as well.
I think this is the official solution: https://docs.anaconda.com/anaconda/install/uninstall/
[Unfortunately I did the simple remove (Uninstall-Anaconda.exe in C:\Users\username\Anaconda3 following the answers in stack overflow) before I found the official article, so I have to get rid of everything manually.]
But for the rest of you the official full removal could be interesting, so I copied it here:
To uninstall Anaconda, you can do a simple remove of the program. This will leave a few files behind, which for most users is just fine. See Option A.
If you also want to remove all traces of the configuration files and directories from Anaconda and its programs, you can download and use the Anaconda-Clean program first, then do a simple remove. See Option B.
Option A. Use simple remove to uninstall Anaconda:
- Windows–In the Control Panel, choose Add or Remove Programs or Uninstall a program, and then select Python 3.6 (Anaconda) or your version of Python.
- [... also solutions for Mac and Linux are provided here: https://docs.anaconda.com/anaconda/install/uninstall/ ]
Option B: Full uninstall using Anaconda-Clean and simple remove.
NOTE: Anaconda-Clean must be run before simple remove.
Install the Anaconda-Clean package from Anaconda Prompt (Terminal on Linux or macOS):
conda install anaconda-cleanIn the same window, run one of these commands:
Remove all Anaconda-related files and directories with a confirmation prompt before deleting each one:
anaconda-cleanOr, remove all Anaconda-related files and directories without being prompted to delete each one:
anaconda-clean --yesAnaconda-Clean creates a backup of all files and directories that might be removed in a folder named .anaconda_backup in your home directory. Also note that Anaconda-Clean leaves your data files in the AnacondaProjects directory untouched.
After using Anaconda-Clean, follow the instructions above in Option A to uninstall Anaconda.
To remove the configs:
conda install anaconda-clean
anaconda-clean --yes
Once the configs are removed you can delete the anaconda install folder, which is usually under your home dir:
rm -rf ~/anaconda3
Also, the anaconda-clean --yes command creates a backup in your home directory of the format ~/.anaconda_backup/<timestamp>. Make sure to delete that one also.
EDIT (v5.2.0): Now if you want to clean all, you will also have to delete the two last lines added to your .bash_profile. They look like:
# added by Anaconda3 5.2.0 installer
export PATH="/Users/ody/anaconda3/bin:$PATH"
To uninstall Anaconda open a terminal window:
- Remove the entire anaconda installation directory:
rm -rf ~/anaconda
- Edit
~/.bash_profileand remove the anaconda directory from yourPATHenvironment variable.
Note: You may need to edit .bashrc and/or .profile files instead of .bash_profile
Remove the following hidden files and directories, which may have been created in the home directory:
.condarc.conda.continuum
Use:
rm -rf ~/.condarc ~/.conda ~/.continuum