DEV Community

Cover image for Install both Anaconda & Python | Windows
fharook shaik
fharook shaik

Posted on

Install both Anaconda & Python | Windows

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

  • Run the installer.
    Alt Text

  • 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

  • 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

  • Run the installer.
  • Make sure that you have checked out ADD Python to PATH.
    Alt Text

  • Click on Customize installation and make few clicks on Next till you've got this page.
    Alt Text

  • 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
Enter fullscreen mode Exit fullscreen mode
  • Type python and you'll be welcomed with python from anaconda environment.
    Alt Text

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

  • To deactivate conda environment, use the following command

conda deactivate
Enter fullscreen mode Exit fullscreen mode

Alt Text

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

πŸ“₯ 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>
Enter fullscreen mode Exit fullscreen mode
  • To install any package/dependency in native python, use the following command
pip install <packageName>
Enter fullscreen mode Exit fullscreen mode

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.

Top comments (3)

Collapse
 
avinashtechlvr profile image
Avinash Chodavarapu

hey fharook, it was a cool blog and working perfectly for me. Thanks for the post and keep posting bro waiting for more posts bro

Collapse
 
fharookshaik profile image
fharook shaik

Glad to here that Avinash! Kudos.πŸ‘πŸ‘.

Collapse
 
lokeshanjuru0210 profile image
lokeshanjuru0210

Absolutely great explanation and clear installing procedure . Thank you so much FHAROOK ,continue the good work.