Learning Python Series 2 — Setting up your environment

Aashish Peepra
TowardsPython
Published in
3 min readMay 2, 2021

--

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.

https://www.python.org/downloads/release/python-394/

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.

https://i.stechies.com/userfiles/images/Python-EV-1.JPG

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.

--

--

Aashish Peepra
TowardsPython

Software Engineer @commenda-eng | 100K+ people used my websites | Mentored 28K+ Developers globally | Google Solution challenge global finalist