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!By mistake in step 6 I entered no, installation is done, but when I use condo command it says command not found. Is there any way to resolve this
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 )
Clear, efficient and no problems while following those instructions. enough explications without unnecessary blabla. Thanks a lot
Guys help, please. I successfully installed anaconda (on Ubuntu 18.04), although I didn’t say yes when it asked to be added to path. But I did that manually by editing my bashrc file.
The problem now is when I create an environment and activate it, Conda doesn’t append it to my terminal prompt.
I only know it’s active by doing conda info :)
I created a test_env as such:
Here is the output of conda info:
Hi Lisa, I use Ubuntu 16.04 LTS and after I installed Anaconda the name “(base)” is appearing before my computer’s name in the terminal. Is there a way to take it off without messing with anaconda installation and its packages? Thanks!
Thanks for this, well written article that helped me a lot :)
Thankyou!! Its really a good guide. tunneling concept which I have learnt.
Good Job.
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.
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