Designed for data science and machine learning workflows, Anaconda is an open-source package manager, environment manager, and distribution of the Python and R programming languages.
This tutorial will guide you through installing Anaconda on an Ubuntu 18.04 server. For a more detailed version of this tutorial, with better explanations of each step, please refer to How To Install the Anaconda Python Distribution on Ubuntu 18.04.
From a web browser, go to the Anaconda Distribution page, available via the following link:
https://www.anaconda.com/distribution/
Find the latest Linux version and copy the link to the installer bash script.
Logged into your Ubuntu 18.04 server as a sudo non-root user, move into the /tmp
directory and use curl
to download the link you copied from the Anaconda website:
- cd /tmp
- curl -O https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh
- bash Anaconda3-2019.03-Linux-x86_64.sh
You’ll receive the following output to review the license agreement by pressing ENTER
until you reach the end.
Output
Welcome to Anaconda3 2021.05
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>
...
Do you approve the license terms? [yes|no]
When you get to the end of the license, type yes
then press ENTER
as long as you agree to the license to complete installation.
Once you agree to the license, you will be prompted to choose the location of the installation. You can press ENTER
to accept the default location, or specify a different location.
OutputAnaconda3 will now be installed into this location:
/home/sammy/anaconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/home/sammy/anaconda3] >>>
At this point, the installation will proceed. Note that the installation process takes some time.
Once installation is complete, you’ll receive the following output:
Output...
installation finished.
Do you wish the installer to initialize Anaconda3
by running conda init? [yes|no]
[no] >>>
It is recommended that you type yes
to use the conda
command.
You can now activate the installation with the following command:
- source ~/.bashrc
Use the conda
command to test the installation and activation:
- conda list
You’ll receive output of all the packages you have available through the Anaconda installation.
You can create Anaconda environments with the conda create
command. For example, a Python 3 environment named my_env
can be created with the following command:
- conda create --name my_env python=3
Activate the new environment like so:
- conda activate my_env
Your command prompt prefix will change to reflect that you are in an active Anaconda environment, and you are now ready to begin work on a project.
Here are links to more detailed tutorials that are related to this guide:
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
thank you Lisa for the detailed steps! one suggestion for step 2: it’s better to use
wget -c
instead ofcurl
over unstable internet connection!Thanks so much for this. It was really well explained and very helpful! I got to Step 8, and was given the error conda not found. Any thoughts on that? Thanks a ton
Thank you for this tutorial I have previously installed anaconda on ubuntu using this tutorial. I got here good information about installing anaconda. This quickstart tutorial makes it really easy to install anaconda on ubuntu.
Very good article. Here is a tutorial video explains how to install anaconda in ubuntu [https://www.youtube.com/watch?v=hFiHhf2u2Jo]
Dear Lisa. Excellent article. Very meticulously written. I followed it to the letter and my Anaconda installation went flawlessly. Thank you very much.
Hi Lisa, In Step-6, I am automatically getting “No” response from the program. Hence not able to activate the conda. What shall I do? I am quite new to both ubuntu and Anaconda
Hi Lisa, It was really a smooth installation following your recommendations, but, like vktud, in Step-6, I automatically put “No” response from the program. Hence I’m not able to activate the conda. What shall I do? Thak you for any help.
At the end, if you have problems (conda command not found) or something like that, remember just add conda’s location to your path.
( https://askubuntu.com/questions/908827/variable-path-issue-conda-command-not-found )
Thankyou!! Its really a good guide. tunneling concept which I have learnt.
Good Job.
Thanks for this, well written article that helped me a lot :)