How To Install Anaconda on Ubuntu 18.04
Anaconda is open-source tool to manage packages, environment and distribution for various python programming projects. Mostly used for large scale data processing, scientific computing for predictive analysis. This contain various packages used widely. It has conda command-line utility.So in this post we will see how we could install Anaconda on Ubuntu 18.04 Desktop.
Collect latest version of Anaconda
To collect latest version of Anaconda, we should open link https://www.anaconda.com/distribution/. In this website you would found link to download link for Linux and other distributions which could suits to your operating systems. I suggest please get latest link of your your own from website instead to use some predefined link from some website.
Download Install scripts
ssirohi@jarvis:/data/conda$ wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh --2020-01-05 18:59:21-- https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh Resolving repo.anaconda.com (repo.anaconda.com)... 2606:4700::6810:8203, 2606:4700::6810:8303, 220.127.116.11, ... Connecting to repo.anaconda.com (repo.anaconda.com)|2606:4700::6810:8203|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 530308481 (506M) [application/x-sh] Saving to: ‘Anaconda3-2019.10-Linux-x86_64.sh’ Anaconda3-2019.10-Linux-x86_64.sh 100%[=======================================>] 505.74M 8.19MB/s in 62s 2020-01-05 19:00:23 (8.15 MB/s) - ‘Anaconda3-2019.10-Linux-x86_64.sh’ saved [530308481/530308481]
Once we download it we have to install it with few simple steps.
ssirohi@jarvis:/data/conda$ ls -lh total 506M -rw-r--r-- 1 ssirohi ssirohi 506M Oct 15 17:20 Anaconda3-2019.10-Linux-x86_64.sh ssirohi@jarvis:/data/conda$ bash Anaconda3-2019.10-Linux-x86_64.sh
It will come up with some simple user agreement to return which need to return with yes.
Welcome to Anaconda3 2019.10 In order to continue the installation process, please review the license agreement. Please, press ENTER to continue >>> Do you accept the license terms? [yes|no] [no] >>> yes
Later it will ask for directory path to which is default to user’s home directory, but we could provide other directory path as well, in case your provided path is already present, you need to call this bash script with -u option.
Anaconda3 will now be installed into this location: /home/ssirohi/anaconda3 - Press ENTER to confirm the location - Press CTRL-C to abort the installation - Or specify a different location below [/home/ssirohi/anaconda3] >>> /data/conda PREFIX=/data/conda Unpacking payload ...
At last it will provide installation summary as described below.
Preparing transaction: done Executing transaction: done installation finished. Do you wish the installer to initialize Anaconda3 by running conda init? [yes|no] [no] >>> yes no change /data/conda/condabin/conda no change /data/conda/bin/conda no change /data/conda/bin/conda-env no change /data/conda/bin/activate no change /data/conda/bin/deactivate no change /data/conda/etc/profile.d/conda.sh no change /data/conda/etc/fish/conf.d/conda.fish no change /data/conda/shell/condabin/Conda.psm1 no change /data/conda/shell/condabin/conda-hook.ps1 no change /data/conda/lib/python3.7/site-packages/xontrib/conda.xsh no change /data/conda/etc/profile.d/conda.csh modified /home/ssirohi/.bashrc ==> 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! =========================================================================== Anaconda and JetBrains are working together to bring you Anaconda-powered environments tightly integrated in the PyCharm IDE. PyCharm for Anaconda is available at: https://www.anaconda.com/pycharm
Try connecting on new console, will show you conda environment PS1 status like below
But in case you are not able to find this on your machine, use below command to make it your environment.
conda config --set auto_activate_base true
You can also remove it with false variable options like below
conda config --set auto_activate_base false
Now we can see conda commands in your profile PATH to make it validate
(base) ssirohi@jarvis:~$ conda update conda Collecting package metadata (current_repodata.json): done Solving environment: done # All requested packages already installed.
In above command we tried to update conda package
We can also check conda info with below command.
(base) ssirohi@jarvis:~$ conda info active environment : base active env location : /data/conda shell level : 1 user config file : /home/ssirohi/.condarc populated config files : /home/ssirohi/.condarc conda version : 4.8.0 conda-build version : 3.18.9 python version : 3.7.4.final.0 virtual packages : __glibc=2.27 base environment : /data/conda (writable) channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /data/conda/pkgs /home/ssirohi/.conda/pkgs envs directories : /data/conda/envs /home/ssirohi/.conda/envs platform : linux-64 user-agent : conda/4.8.0 requests/2.22.0 CPython/3.7.4 Linux/4.15.0-72-generic ubuntu/18.04.3 glibc/2.27 UID:GID : 1000:1000 netrc file : None offline mode : False
Now in this environment my python is 3.7 as compared to normal one
(base) ssirohi@jarvis:~$ which python /data/conda/bin/python (base) ssirohi@jarvis:~$ python --version Python 3.7.4 (base) ssirohi@jarvis:~$