This article was first published in: https://www.itcoder.tech/posts/how-to-install-anaconda-on-ubuntu-20-04/
Anaconda is a popular Python/R data science and machine learning platform, big data processing, predictive analysis, and scientific computing.
The Anaconda distribution comes with 250 open source data packages, and more than 7,500 packages can be installed from the Anaconda software source. It also contains a command line tool and a graphical user interface called "Anaconda Navigator".
This guide will explain to you the installation process of Anaconda Python distribution on Ubuntu 20.04.
At the time of writing this article, the latest binding version of Anaconda is 2020.02. Before downloading the installation script, browse the download page, and check if there is an updated Anaconda available.
Complete the following steps on Ubuntu 20.04 to install Anaconda.
sudo apt install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6
wget
to download the Anaconda installation script:wget -P /tmp https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh
The download will take some time, depending on your internet speed.
Use the sha256sum
command to display the checksum of the script:
sha256sum /tmp/Anaconda3-2020.02-Linux-x86_64.sh
The output is similar to:
2 b9f088b2022edb474915d9f69a803d6449d5fdb4c303041f60ac4aefcc208bb /tmp/Anaconda3-2020.02-Linux-x86_64.sh
Make sure that the hash value printed by the above command is the same as the Anaconda hash value of the corresponding version of the Anaconda with Python 3 on 64-bit Linux page page.
https://docs.anaconda.com/anaconda/install/hashes/Anaconda3-2020.02-Linux-x86_64.sh-hash/
bash /tmp/Anaconda3-2020.02-Linux-x86_64.sh
You should see the following output:
Welcome to Anaconda3 2020.02
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue>>>
Press ENTER
to continue. Swipe down to read the agreement and use the ENTER
button. Once you have read the agreement, you will be asked whether to accept the terms of the agreement:
Do you approve the license terms?[yes|no]
Enter yes
to accept the agreement, and you will be prompted to choose the installation path:
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 should be directly available to most users. Press Enter
to confirm the position.
The installation process will take some time, and once completed, the script will ask you if you want to run conda init
. Enter yes
.
Installation finished.
Do you wish the installer to initialize Anaconda3
by running conda init?[yes|no]
This will add the command line tool conda
to the system's PATH
environment variable.
To activate Anaconda, you can close and reopen your shell or enter the following command in the current shell session to reload the PATH
environment variable:
source ~/.bashrc
To verify the installation process, enter conda
in your terminal.
that's it. You have successfully installed Anaconda on your Ubuntu machine, and you can start using it.
If you install Anaconda on a desktop system, enter anaconda-navigator
in the terminal to open the Navigator GUI:
Upgrading Anaconda is a very straightforward process. Open your terminal and enter:
conda update --all
If there is an update, conda
will display a list and prompt you to confirm whether to update:
The following packages will be UPDATED:
anaconda-navigator 1.9.12-py37_0 -->1.9.12-py37_1
conda 4.8.2-py37_0 -->4.8.3-py37_0
conda-package-han~1.6.0-py37h7b6447c_0 -->1.6.1-py37h7b6447c_0
Proceed([y]/n)?
It is a good idea to upgrade Anaconda regularly.
If you want to uninstall Anaconda from your Ubuntu system, remove the Anaconda installation directory and other files created during the installation process:
rm -rf ~/anaconda3 ~/.condarc ~/.conda ~/.continuum
Open ~/.bashrc
and remove Anaconda from the environment variables:
# >>> 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"elseif[-f "/home/linuxize/anaconda3/etc/profile.d/conda.sh"]; then
." /home/linuxize/anaconda3/etc/profile.d/conda.sh"elseexport PATH="/home/linuxize/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
We have shown you how to install Anaconda on Ubuntu 20.04. Now you should take a look at the Official conda Getting Started Guide.
If you have any questions, please contact us in the following ways:
WeChat:
WeChat group: add the above WeChat, remark the WeChat group
QQ: 3217680847
QQ Group: 82695646
Recommended Posts