On this page are basic instructions for downloading, installing and uninstalling Anaconda in your personal directory. However, please note that the VACC is not responsible for troubleshooting or maintaining software you have installed yourself.
For more information about Anaconda, see the Anaconda User Guide.
NOTE: If you need to install programs that require Anaconda, you may consider installing Miniconda instead. Miniconda is a light-weight version of Anaconda and allows you to save some disk space and potentially avoid package conflicts. You can follow these same instructions for installing Miniconda.
Install
Where to Install
You will want to install Anaconda in your main directory (gpfs1) and not in scratch (gpfs2).
Downloading
To download Anaconda to your VACC directory, you will:
- Find the version of the installer for Linux-x86_64 that you want in the Anaconda Repository. (For Miniconda, see the Miniconda Repository.)
- Copy the link of the installer version you need. For example, for the latest Anaconda version (as of August 2024), the link is: https://repo.anaconda.com/archive/Anaconda3-2024.06-1-Linux-x86_64.sh
- Use
wget -c
along with the link from step 2.
For example, if you wanted to download the latest Anaconda version, you would use this command:
wget -c https://repo.anaconda.com/archive/Anaconda3-2024.06-1-Linux-x86_64.sh
Installing
- Now that you have the installer file in your directory, you can use it to install Anaconda using the
bash
command. For example, if you downloaded the latest Anaconda version (Anaconda3-2024.06-1-Linux-x86_64.sh), you would use this command to install it:bash Anaconda3-2024.06-1-Linux-x86_64.sh
- Hit ENTER many times to get through the user license.
- Answer “yes” at the end of the license agreement.
- You can then choose where you would like to install the program. We recommend pressing ENTER for the default location.
- Answer “yes” to “Do you wish the installer to initialize Anaconda3 by running conda init?”
- Exit your command shell and restart it. (This is necessary for Anaconda to initialize.)
Unsetting Automatic Start
When you restart your shell, you will see “(base)” at the beginning of your command prompt. This is because Anaconda has automatically started when you logged in. We recommend unsetting this automatic start so that you are only in Anaconda when you want to be. Use this command to unset the automatic start:
conda config --set auto_activate_base false
Starting/Exiting Anaconda
To start Anaconda, use the command conda activate
(version 4.4 and later) or source activate
(earlier versions).
To exit Anaconda, use the command conda deactivate
(version 4.4 and later) or source deactivate
(earlier versions).
Using Environments
In Anaconda, it is best practice to always create an environment with the name of your project, the version of Python you need, and install your packages there. Do not install packages in the root of your Anaconda install.
For information about creating environments and more, see Managing Environments in the Anaconda Documentation.
Uninstall
To uninstall Anaconda:
- Find the directory name of your Anaconda install by using the command
ls
to see all the subdirectories in your directory. It is usually something like “anaconda3.” - Replace “directory name” in the following code with the name of the directory you found in step 1. Use
rm -rf directory name
to remove the Anaconda directory. This will take a couple of minutes to execute. - Use
ls -a
to see all files in your directory, including hidden files. You should see that Conda has added “.conda.” If you unset automatic start, it also added “.condarc.” You will also see your .bashrc file, which we will edit in step 5. - Remove .conda and .condarc. (Note: .conda is a directory.)
Use the commands:rm -rf .conda
and thenrm .condarc
. - Conda will have put initialization code in your .bashrc file that you now want to delete. Do not delete your .bashrc file. Do not delete anything other than conda code from your .bashrc file. Depending on the version of conda that you installed, you may see:
# >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('/users/k/t/ktoksu/miniconda3/bin/conda' 'shell.bash' 'hook' 2$ if [ $? -eq 0 ]; then eval "$__conda_setup" else if [ -f "/users/k/t/ktoksu/miniconda3/etc/profile.d/conda.sh" ]; then . "/users/k/t/ktoksu/miniconda3/etc/profile.d/conda.sh" else export PATH="/users/k/t/ktoksu/miniconda3/bin:$PATH" fi fi unset __conda_setup # <<< conda initialize <<<
Delete all of the above conda code. To do this, you can use the command
nano .bashrc
to open your .bashrc file in the nano editor. You can use your DOWN arrow key to get to the line below “# <<< conda initialize <<<“. Then use your BACKSPACE key to delete. When you are done editing, exit and save the file.
You’re done!