The way to uninstall Miniconda

Updated at

2024.2.19

Created at

2022.8.15

I tried to uninstall Miniconda 3 and reinstall it with pyenv, but I failed because some configuration remained.

Delete the directory

Show the path of the virtual environment with the below command:

terminal
$ conda env list
# conda environments:
#
base         *  /Users/[user]/opt/anaconda3

Delete the directory for Miniconda.

terminal
$ rm -rf ~/opt/miniconda3

Delete the configuration

Delete the configuration .bash_profile and .zshrc from when installed.

terminal
$ nano ~/.zshrc

The configuration to delete is surrounded by the commented out messages.

.zshrc
# >>> conda initialize >>>
...
# <<< conda initialize <<<
terminal
$ rm -rf ~/.condarc ~/.conda ~/.continuum

Delete the environment variables

terminal
$ env | grep CONDA
CONDA_EXE=/Users/[user]/opt/miniconda3/bin/conda
_CE_CONDA=
CONDA_PYTHON_EXE=/Users/[user]/opt/miniconda3/bin/python
CONDA_SHLVL=3
CONDA_PREFIX=/Users/[user]/opt/miniconda3/envs/[environment]
CONDA_DEFAULT_EXE=[environment]
CONDA_PROMPT_MODIFIER=([environment])
CONDA_PREFIX_1=/Users/[user]/anaconda3
CONDA_PREFIX_1=/Users/[user]/opt/miniconda3

If these variables remain, you will fail to reinstall. Delete the variables with the below command:

terminal
$ unset CONDA_XXX

Next step:

mktia's note

Research & Engineering / Blockchain / Web Dev

© 2017-2025 mktia. All rights reserved.