How to Install Anaconda on CentOS 8
4 min read
Anaconda is the most popular Python/R data science and machine learning platform. It is used for large-scale data processing, predictive analytics, and scientific computing.
Anaconda distribution ships with more than 1,500 open-source data packages. It also includes the
conda command-line tool and a desktop graphical user interface called Anaconda Navigator.
In this tutorial, we will explain how to install Anaconda Python Distribution on CentOS 8.
At the time of writing this article, the latest stable version of Anaconda is version 2019.10. Before downloading the Anaconda installer script, visit the Anaconda Downloads page and check if there is a new version of Anaconda for Python 3 available for download.
Complete the following steps to install Anaconda on CentOS 8:
Download the Anaconda installation script using the link that you copied from the Downloads page:
wget -P /tmp https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh
The download may take some time depending on your connection speed.
If you are installing Anaconda on a Desktop machine, you can download the script using your web browser .
Verify the data integrity of the script with the
The output should look like the following:
Make sure the hash printed from the command above matches the one available at the Anaconda with Python 3 on 64-bit Linux page for your appropriate Anaconda version.
Start the Anaconda installation process by executing the installation script:
You should see an output like the following:
Welcome to Anaconda3 2019.10 In order to continue the installation process, please review the license agreement. Please, press ENTER to continue >>>
ENTERto continue, and then press
ENTERto scroll through the license. You’ll be asked to approve the license terms:
Do you accept the license terms? [yes|no] [no] >>> yes
yesto accept the license and the installer will ask you to choose the installation location:
Anaconda3 will now be installed into this location: /home/linuxize/anaconda3 - Press ENTER to confirm the location - Press CTRL-C to abort the installation - Or specify a different location below
The default location is fine for most users. Press
ENTERto confirm the location and installation process will continue.
If you get an error saying
bunzip2: command not found, install the
sudo dnf install bzip2, and re-run the installation script
The installation may take some time to complete. Once done, you’ll see the following output:
Preparing transaction: done Executing transaction: done installation finished. Do you wish the installer to initialize Anaconda3 by running conda init? [yes|no]
ENTERand the script will add
==> For changes to take effect, close and re-open your current shell. <== If you'd prefer that conda's base environment not be activated on startup, set the auto_activate_base parameter to false: conda config --set auto_activate_base false Thank you for installing Anaconda3! ...
To activate the Anaconda installation, you can either close and re-open your shell or load the new
PATHenvironment variable into the current shell session by typing:
condacommand to verify the Anaconda installation. The following command will display information about the installation:
active environment : base active env location : /home/vagrant/anaconda3 shell level : 1 user config file : /home/vagrant/.condarc populated config files : conda version : 4.7.12 conda-build version : 3.18.9 python version : 3.7.4.final.0 ...
Updating the Anaconda is a pretty straight forward process, first update the conda tool with:
conda update conda
When prompted to confirm the update, type
y to proceed.
Once conda is updated, proceed with the Anaconda update:
conda update anaconda
Same as with the previous command, when prompted, type
y to proceed.
Do not forget to regularly update your Anaconda installation.
To uninstall Anaconda from your CentOS system, first remove the Anaconda installation directory:
rm -rf ~/anaconda3
~/.bashrc file and remove the Anaconda directory from the PATH environment variable:
# >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('/home/linuxize/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else if [ -f "/home/linuxize/anaconda3/etc/profile.d/conda.sh" ]; then . "/home/linuxize/anaconda3/etc/profile.d/conda.sh" else export PATH="/home/linuxize/anaconda3/bin:$PATH" fi fi unset __conda_setup # <<< conda initialize <<<
Run the following
command to remove the hidden files and folders from the user home directory:
rm -rf ~/.condarc ~/.conda ~/.continuum
Now that you have downloaded and installed Anaconda your CentOS system, you can check the official Getting started with conda guide.
If you hit a problem or have feedback, leave a comment below.