What is Anaconda Navigator ?

Installing Anaconda

In this post, we talk about how to set up our machine to start programming in python.
We will understand the important notion of virtual environments and how to set up a virtual environment and why do we need a virtual environment.

So, Fresh up your mind and let's start exploring!

If you search in google how to install python, then the first page which popups may be of the homepage of python.org where you will find the different installation packages depending upon your machine configuration.

That's okay, but here I am going to tell you about a powerful software which you should have from the beginning of your python learning journey. This software is as powerful as its name.
This will give you everything you will be needed in your future endeavor of python.

Anaconda Package

Go to the https://docs.anaconda.com/anaconda/install/ and install anaconda for your windows operating system.

That's it. Your programming life is sorted now. you must be wondering where is python huh? Wait, it's there inside the huge stomach of anaconda!!!

Double click on anaconda navigator icon and wait till it opens up. you should be seeing a window like this-

We will discuss the items available in anaconda in a later post, For now we will work with the command line shell of anaconda.

close the anaconda navigator, and search for Anaconda Prompt. open the anaconda prompt you will see a command-line interface like this--

You will see something like this. Don't panic, I will be going to make this black screen most interesting as we further drive deep.

(base) C:\User\Srujan Kachhwaha>

This Line has so much information you should know about!
1. (base) --> This indicates the currently active virtual environment.
2. C:\User\Srujan Kachhwaha --> Indicates the current working directory.

Now, what is the virtual environment!!!

Virtual Environment In Anaconda

Virtual Environment, as the name indicates provides you a separate environment for your different python projects.
Think virtual environments as different isolated boxes, The content of one box is isolated from the contents of another box.

When we work more in python and start doing projects, we have to install several libraries, several codes to import and we don't want to mess the things up with the different contents of one project with other projects.

To resolve this issue, we create different environments for different projects. These environments isolate their content and make our work easy.

How to create a virtual environment in anaconda

There are several commands available in anaconda, Type:

conda --help

It will list different types of the command you can use in anaconda prompt.

Now, let's create a virtual environment with the name as myEnv

conda create --name myEnv

This will create a new environment with the name of myEnv.

To list the available virtual environments, Type:

conda info --env

You can observe the list of virtual environments available!!! Now, how to know, if you are in the correct environment or not? Simple, observe the * mark, It indicates the current environment.

Also, the current environment is indicated by the line (base) c:\user\srujan kachhwaha\
Right now we at the base environment, let's change to the new environment we created.

conda activate myEnv

Now, the current environment is myEnv!!!

Wooh!!! That's a lot to grasp!!! but trust me, This will help you a lot. Want some motivation before moving further! Remember Tony stark our Iron man once said, Do the difficult job before an easy one!

So, Let's dive deeper now!!!

Managing python in anaconda prompt

So, we in the virtual environment of myEnv. Let's install python for this environment.
You heard it right. As the different environments are isolated from each other, you should install python after creating a new environment. That's the beauty of creating environments. It keeps all our work organized.

To install python just type:

conda install python

type Y, to proceed further.

This command will automatically install the latest version of python in your virtual environment.
you can use this command to install any libraries for your python you want!!!

Hurray!!! we have successfully installed the python in our machine. We are ready to go now.
To launch python, just type python.\

It's that simple. you will see something like this:

This is called a python interactive shell. Here you can write all the commands you learned in the foundation post of getting started with python!

Click the link if you haven't read that post yet! 

We have covered a lot of concepts, it's time to give rest. You have done a great job! pat yourself.
We have learned how to work with anaconda
how to create an environment
how to install packages.

We will meet in a later post. Bye
Thank you!!

Post a Comment