100 days of code: Day 49 - anaconda

Last modified on 2020-07-28

Source: 100-days-of-code.

Anaconda is a Python distribution optimized for data science and machine learning. A little self-contained universe of Python libraries and tools. Sounds cool!

Install on Debian

Navigate to the Anaconda installer archive and download the latest Linux installer package Anaconda3-DATE-Linux-x86_64.sh.

Verify the download with md5sum and run the install script (Anaconda uses 3.9G of storage on my system) …

$ md5sum Anaconda3-2020.07-Linux-x86_64.sh
1046c40a314ab2531e4c099741530ada  Anaconda3-2020.07-Linux-x86_64.sh
$ sh Anaconda3-2020.07-Linux-x86_64.sh

Anaconda includes a package manager named conda. Add to PATH by allowing the installer to write to ~/.bashrc by choosing yes

Preparing transaction: done
Executing transaction: done
installation finished.
Do you wish the installer to initialize Anaconda3
by running conda init? [yes|no]
[no] >>> yes

Reload ~/.bashrc

$ source ~/.bashrc

… which activate’s the conda base environment and adds base to the shell prompt …

(base) $

De-activate this behaviour by running …

$ conda config --set auto_activate_base false
$ source ~/.bashrc

Setting is saved to ~/.condarc.

To re-activate the environment run conda activate

$ python --version && which python
Python 2.7.16
/usr/bin/python
$ conda activate
(base) $ python --version && which python
Python 3.8.3
/home/dwa/code/anaconda3/bin/python

Display information about Anaconda and the included Python environment …

$ conda info
$ conda list
$ python
Python 3.8.3 (default, Jul  2 2020, 16:21:59) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

Updating Anaconda …

$ conda update conda
$ conda update anaconda

Run …

$ anaconda-navigator

Link: Anaconda cheatsheet

Happy hacking!