×

Menu

Anaconda Installation process
Creating a new conda environment Activating and deactivating an environment Updating an environment Cloning an environment Removing an environment
Installing packages in anaconda environment

AI_FOR_ALL

How to install Anaconda on Windows

Published 18/3/217 min read
image
Image Credit: Anaconda

Anaconda is a free and open source distribution of Python and R programming language for scientific computing. It is extensively used in data science, machine learning, deep learning and large scale data processing applications. It simplifies package management and deployment.

Let’s see how to install Anaconda on windows and how to create a virtual environment

Anaconda installation process

Step 1:

Open your browser and type the following URL in address bar https://anaconda.com

image
Step 1

Step 2:

Select individual edition from products.

image
Step 2

Step 3:

Click on Download and you will be redirected to the download options.

image
Step 3

Step 4:

Click on 32-bit or 64-bit installer option depending upon your system configuration..

image
Step 4

Step 5:

Run the setup file after downloading, to start the installation process.

image
Step 5.1
image
Step 5.2
image
Step 5.3
image
Step 5.4

Here you can either select add to path option and add anaconda directly to path during installation, this enables you to run anaconda from anywhere in the command window or you can choose to not select this option add anaconda to path later.

Click on install option to start the installation

image
Step 5.5

Once the installation is completed you will be see this window

image
Step 5.6
image
Step 5.7
image
Step 5.8

Step 6:

Once the installation is finished, following files will be installed on your windows system.

image
Step 6.1

Now open the anaconda navigator

Since we will be using jupyter notebook extensively, you can launch Jupyter notebook directly from anaconda navigator

image
Step 6.2

To check if Anaconda has been correctly added to path, run command prompt and type conda. It should give you a list of all the anaconda commands

image
Step 6.3

Conda commands:

Creating a new conda environment:

To create a new environment you can use the following command:

conda create --name myenv

When asked to proceed, type y:

proceed ([y]/n)?

NOTE: Here, replace myenv with the name of your environment

image

To create an environment with specific version of python the command is:

conda create -n myenv python==3.6

To create an environment with specific package the command is:

conda create -n myenv numpy

To create an environment with specific version of python and multiple packages the command is:

conda create --n myenv python==3.6 numpy==1.10

To create an environment from a yml fileuse the following command:

conda env create -f environment.yml

A yml file contains a list of all the packages you want to install in an environment. It is ideal to use a yml file while creating an environment as you can easily share your environment setup with anyone who wants to reproduce your results and you always have a backup of your setup. Incase something goes wrong you can easily create your environment again with the exact same setup. The first line of the yml file sets the name for the environment

You can use the following command for more information

conda create --help

The following command gives you a list of all the installed environments

conda env list

Activating and deactivating an environment:

To activate an environment you can use the following command:

conda activate myenv

image

Once your environment is running you can use the following command to deactivate the running environment

conda deactivate

image

Updating an environment:

To update an environment you can use the following command:

conda activate myenv

conda update --all

OR without activating the environment

conda update --n myenv --all

To update an existing environment from a yml file you can use the following command:

conda activate myenv

conda env update --file environment.yml

OR without activating the environment

conda env update --name myenv --file environment.yml

Cloning an environment:

To clone an environment you can use the following command:

conda create --name myclone --clone myenv

Here, myclone is the name of the new environment and myenv is the name the existing environment

Removing an environment:

To remove an environment you can use the following command:

conda env remove -n myenv

Installing packages in a conda environment:

Conda install:

To install packages in a conda environment you can use the following commands:

conda activate myenv

conda install <packagename>

Pip install:

To install packages in a conda environment using pip package installer you can use the following commands:

conda activate myenv

pip install <packagename>

❗ NOTE: While installing packages make sure you are running command prompt as administrator to avoid any permission errors