How to Install Python Anaconda in ubuntu 16.04

How to Install Python Anaconda in Ubuntu 16.04

Generally, all the major Linux distributions come up with a base Python package. If you update the core interpreter, it might affect certain os utilities. However, if you use a third-party distribution, you are free to add/remove packages and update python as much as you want and your os will remain fully operational. In this tutorial, you will learn about the method to install  Python Anaconda in Ubuntu 16.04.


Installing Python Anaconda

 

Minimum of 3GB disk space is required to download and install Python Anaconda and all its packages.

Depending upon preferred python version, you can download the Anaconda installer. Here, Python 3.6 is downloaded for 64-bit architecture. Make sure you use the wget command followed by the download link. 

[root@linuxhelp ~]# wget https://repo.continuum.io/archive/Anaconda3-5.0.0.1-Linux-x86_64.sh
--2018-02-08 21:48:29--  https://repo.continuum.io/archive/Anaconda3-5.0.0.1-Linux-x86_64.sh
Resolving repo.continuum.io (repo.continuum.io)... 104.16.18.10, 104.16.19.10, 2400:cb00:2048:1::6810:120a, ...
.
Saving to: ‘ Anaconda3-5.0.0.1-Linux-x86_64.sh.1’ 
100%[===================================================================================================> ] 549,434,488  761KB/s   in 10m 52s

 

Once you' ve downloaded the installer, you can simply run the installer using shell command sh just in the following way. 

root@linuxhelp ~]# sh Anaconda3-5.0.0.1-Linux-x86_64.sh
The installer will then begin and proceed with a series of questions.
Do you accept the license terms? [yes|no]
[no] > > > 
Please answer ' yes'  or ' no' :' 
> > >  yes
Anaconda3 will now be installed into this location:
/root/anaconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/root/anaconda3] > > >  /usr/local/anaconda/
PREFIX=/usr/local/anaconda
Towards the end, when it asks if you want to prepend Anaconda to your OS’ s PATH variable, select ‘ Yes’ . This will make running Conda commands a lot easier
Do you wish the installer to prepend the Anaconda3 install location
to PATH in your /root/.bashrc ? [yes|no]
[no] > > >  yes
Appending source /usr/local/anaconda/bin/activate to /root/.bashrc
A backup will be made to: /root/.bashrc-anaconda3.bak
For this change to become active, you have to open a new terminal.
Thank you for installing Anaconda3!
To make the changes to take effect, close and then re-open your Terminal window.

 

Afterwards, you need to test and see if the installation was proper. So, in your Terminal window run the following command.

[root@linuxhelp ~]# conda list
# packages in environment at /usr/local/anaconda:
#
_ipyw_jlab_nb_ext_conf    0.1.0            py36he11e457_0
alabaster                 0.7.10           py36h306e16b_0
anaconda                  5.0.0.1          py36hfb0b618_1
.
.
zict                      0.1.2            py36ha0d441b_0
zlib                      1.2.11               hfbfcf68_1


If your installation is successful, all the installed packages will be listed in the alphabetical order just like displayed above.    You can also confirm with the newly installed Python location by just typing the command.

[root@linuxhelp ~]# which python
/usr/local/anaconda/bin/python

 

Also, you can check it by viewing the version of your newly installed Python. 

[root@linuxhelp ~]# python -V
Python 3.6.2 :: Anaconda, Inc.


Anaconda is ready to be used.  By using the conda  command you can easily manage the packages. Run the following command to make use of it. 

[root@linuxhelp ~]# conda update python
anaconda: 5.0.0.1-py36hfb0b618_1 -->  custom-py36_0
conda: 4.3.27-py36h2866c0b_0 -->  4.3.29-py36ha26b0c0_0
python: 3.6.2-hdfe5801_15 -->  3.6.3-hc9025b9_1
Proceed ([y]/n)? y

 

Uninstalling Python Anaconda

To uninstall Python Anconda, you can just remove the installation folder and remove the environment variables set in .bashrc file. In this installation set up, the uninstallation of Anacondo is triggered with the following command. 

[root@linuxhelp ~]# rm -rf /usr/local/anaconda/

 

And finally, you can edit the ~/.bashrc file and remove the following entries added to Anaconda directory from your PATH environment variable

[root@linuxhelp ~]# export PATH=" /usr/local/anaconda/bin:$PATH" 

By installing this distribution, you’ re free to add or remove packages and update Python to any new versions as you want, without interfering with your underlying OS.

FAQ
Q
How tio install Theano using anaconda?
A
To install Theano with acceleration:

On Windows, run conda install theano.
On Linux and macOS run conda install gcc theano.

NOTE: Theano is available from the default Anaconda channels for Windows, macOS and Linux with the command conda install theano.
Q
What is the default path for installing Anaconda?
A
Windows : C:\Users\\Anaconda3\
macOS: /Users//anaconda3
Linux: /home//anaconda3
Q
What is Python Anaconda?
A
Anaconda is a free and open source distribution of the Python and R programming languages for data science and machine learning related applications, that aims to simplify package management and deployment. Package versions are managed by the package management system conda.
Q
Where to download the repo for anaconda?
A
use the link to get download the source package of anaconda "https://repo.continuum.io/archive/".
Q
How do I get Anaconda with Python 3.5 or 3.6?
A
There are three ways to get Anaconda with Python 3.5 or 3.6:

We recommend that you download the latest version of Anaconda and then make a Python 3.5 (or 3.6) environment.
Or download the latest version of Anaconda and run the following command to install Python 3.5 (or 3.6) in the root environment: conda install python=3.5
or

conda install python=3.6

Or download the most recent Anaconda installer that included Python 3.5 (Anaconda 4.2.0) or Python 3.6 (Anaconda 5.2.0). You can download either of these from our archive. Scroll down the page until you find the version you need for your platform.