ANACONDA 101

Namrata Tanwani
Analytics Vidhya
Published in
3 min readJan 7, 2021

--

So anyone here who is beginning with Anaconda that too on Windows, You have got to thank the developers of it first, because us Windows people aren’t as blessed as ‘Linux-based OS’ people (Please don’t send a link to how to dual boot Ubuntu with Windows 10). If you know, you know.

And if you don’t know, here’s why:

Linux supports almost all of the programming languages such as Java, Python, Julia, Ruby, C, and C++ to name a few, by default.

‘Linux-based OS’ people know what it feels like to have everything at one place. Not like Windows people who have to download packages/libraries for everything.

This is why you’d be elated working with Anaconda. Just so you know, Anaconda is the one go-to environment having all the high performing Data Science libraries for Windows, macOS and Linux. Of course, it revolves majorly around Python, but you can find packages for R installed as well. This is a place where you’ll not only be blessed with different Data Science libraries/packages but with different IDEs too! It makes everything easier for working on a Data Science project.

It is important to know that besides having to download Anaconda, you have the option of installing Miniconda as well, which is a free minimal installer for conda and a small and simple version of Anaconda.

Anaconda has over 1500 packages and takes up to 3 GB of space so if you do not have this much space to spare or do not need these many packages, you can go for Miniconda.

You can also install more packages or create virtual environments with the help of conda. So what is Conda you ask? “Conda is an open source package management system and environment management system that runs on Windows, macOS and Linux.”. So, It basically helps you install packages (just like, pip) and create and jump from one environment to another. It can also help you work with other application stacks such as: Java, Node.js etc.

So here are some commands that should be useful for you if you’re beginning with Anaconda:

*cues to reading documentation*

courtesy: tenor.com

1. For getting started:

· To verify if Conda is installed and check its version

conda info

· To update all packages to the latest version of Anaconda. It installs stable and compatible versions, not the very latest though.

conda update anaconda

2. Using packages and channels

· To install a package

conda install PKGNAME

· To install a package by exact version number (3.1.4)

 conda install PKGNAME==3.1.4

·To install one of the listed versions (OR)

conda install “PKGNAME[version=’3.1.2|3.1.4']”

· To install following several constraints (AND)

conda install “PKGNAME>2.5,<3.2”

3. For working with environments

· To create a new environment named ENVNAME

conda create --name ENVNAME

· To create a new environment named ENVNAME with specific version of Python and packages installed

 conda create --name ENVNAME python=3.6 “PKG1>7.6” PKG2

· To activate a named Conda environment

conda activate ENVNAME

· To deactivate current environment

conda deactivate

· To list all packages and versions in a named environment

conda list --name ENVNAME

· To Create an environment based on exact package versions

conda create — name NEWENV --file pkgs.txt

· To Export an environment to a YAML file that can be read on Windows, macOS, and Linux

 conda env export --name ENVNAME > envname.yml

4. Miscellaneous

· For full documentation of any command, add — (double hyphen)help to the command

conda create --help

· To get a detailed information about package versions

 conda search PKGNAME --info

·To remove a package from an environment

 conda uninstall PKGNAME --name ENVNAME

--

--