Learning Python Series 2 — Setting up your environment

Aashish Peepra
May 2 · 3 min read
Photo by Fotis Fotopoulos on Unsplash

We will see how to set up a coding environment for Python. Here’s a few things which we will require to get started.

1. Surprisingly we will need Python to be installed on our system.

Go to https://www.python.org/downloads/ and download the latest version of python. For windows you can download the graphical installer.


If you are on Linux you might already have python installed.

2. Correct way to get it done!

Picture of Python installer wizard

Now make sure you check this checkbox. It adds Python to the list of environment variables.

What are environment variables and why should Python be added into it?

Environment variables are like contacts on your phone. The name of your contact is the way you remember it, but what actually matters is the number associated with that name. Environment variables are names of file locations. This way you don’t need to remember “C:\Users\Laptop\something\abracadabra”, you can simply remember the name of variable holding this file path. One more thing, environment variables are mostly useful for the operating system.

Bunch of environment variables on my system

To access the environment variables

Search “This PC” -> Right click on it and go to properties -> Click on “Advanced system settings” -> That’s it.

If Python isn’t added into environment variable, you won’t be able to globally access it from command line / Powershell ( or just won’t be able to access it outside of it’s directory ) and you will get an error like this.


3. Let’s test our installation.

Testing if Python is installed correctly

To test if Python is installed correctly, simply open cmd or powershell. Type python and hit enter. You will see an output like above.

4. But where to write the sassy code?

Well you can write code in notepad file, save it with .py extension and run it from command prompt with

python nameOfFile.py

But what’s fun in that. There are tons of IDEs (Integrated Development environments) where you can code like a pro.

What I prefer is Visual Studio Code. It’s free, have tons of extensions and the color themes are amazing.

Download Visual Studio Code.

What’s next?

If you want to learn Python. Keep reading this series. 🚀

If you are a person who prefers learning from video more than reading books, check out my Udemy Course.


Everything you need to know about Python

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store