Install both Anaconda & Python | Windows
Tags: anaconda, python, windows, tutorial
Published: 2021-02-02 09:25:03

This post provides you a thorough description of how to install both the anaconda and python versions on your Windows computer, and how to access them individually.

----------------------

### **✏ Introduction.**

If you're reading this post, then you're either an ML enthusiast or an enthusiast like me to try various python distributions 😅.

As a python developer, there will be situations where one needs to work with more than one distributions of python. And it's known fact that accessing different distributions of python is a bit tricky and can be a hectic job for beginners. Well, after reading this post, hope you'll get a clear picture how to use both with ease.

-------------------------

#### **📃 Requirements** 

* A Windows 10 operating machine.
* Python (any version).
* Anaconda Distribution Package.

That's it. 

> In this scenario, I'll be using latest version of Python 3.9.1, however you're free to use any version of python.

---------------------------

### **Install Anaconda Distribution**

Download the latest version of Anaconda Distribution [here](https://www.anaconda.com/products/individual#Downloads)

* Run the installer.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7cc1r1yfftpwtuob5txz.png)

* Make sure you have checked out **Add Anaconda3 to my PATH environment variable.** This provides the flexibility to access the distribution of anaconda python anywhere from the PC.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qdhht10xfc3yccet2lqj.png)

* Click on **Install**. Hang on some time, the installation will take a while depending on your system performance.

* Once installed, do a quick run of Anaconda Navigator and ensure it's running fine.

------------------------

### **🐍 Install Python**

Download the appropriate version python exe installer from [here](https://www.python.org/downloads/)

* Run the **installer**.
* Make sure that you have checked out **ADD Python <version> to PATH**. 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/v03rm0c5uvg3jocp43xd.png)

* Click on **Customize installation** and make few clicks on Next till you've got this page.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/weazuryef58yfqwfkt6j.png)

* Choose a custom location other than the default. In this case I've choose `D:\Python39`.

* Click on **Install** and hang on for few moments until it get installed.

------------------------

### **🤔 How to Access Anaconda & Python from `cmd`?**

#### Accessing Anaconda from `cmd`:

It's actually simple to access / activate anaconda distribution.
* Open `command prompt` and use the following command to activate conda base environment.

```
conda activate base
```
* Type `python` and you'll be welcomed with python from anaconda environment.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0r1lpbis9kg7bx3gvuq7.png)

* The `(base)` before the path indicates that conda environment is active.

* To deactivate conda environment, use the following command

```
conda deactivate
```

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5bbobwo1h9acjr26mtij.png)

Well, with that you've learned how to access/activate conda environment using `cmd`, let's look into accessing python environment using `cmd`.

> Note: Every anaconda distribution comes with base environment. Any additional virtual environments created inside anaconda can be activated using the `conda activate <envname>`

------------

#### Accessing Python from `cmd`:

A simple thing to remember here, just make sure that you're not in `conda` environment in order to access Native Python distribution.

* Just type `python` or `py` to open the python interpreter.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/sd9zcd7yqurg61n545eu.png)

----------------------------------

### **📥 Install packages differently**

With both the distributions installed, you have control on installing packages separately for each distribution.

* To install any package/dependency in conda environment, use the following command

```
conda install <packageName>
```

* To install any package/dependency in native python, use the following command

```
pip install <packageName>
```

That's it! ✌
See you in next post!👋

***Feel free to comment down any type of doubts/issues you've encountered. Would ❤️ to help. 
Find this insightful***🤔 ***Give a ❤️ & share the knowledge with your friends.***