How to Install Python on Windows [Beginner’s Guide]

3 min


This simple guide demonstrates how to download and install Python on Windows.

This article is tested with the latest Python 3.11 stable version.

Before you learn how to install Python on Windows, you might want to check how you can install it easily on Linux distributions such as Ubuntu. It’s better to try Python in Linux if you are planning to be a developer. That being said, you might want to check how to install Linux (such as Ubuntu) alongside Windows.

Python is a popular general-purpose programming language which becomes the developer’s choice in the past decade. And its popularity is increasing every day. it is widely used for web development, complex systems, data science, machine learning and all areas of science.

There are two versions of Python that you may come across. Python2 is currently out of support. And the Python3 series is the ongoing support release.

Check whether Python is installed

Before you install it on Windows, you should check whether it is already installed. In general, it should not be installed, unlike in Ubuntu (and other Linux distributions), where Python comes pre-installed.

From the start menu, open “command prompt”.

And type the following:

python --version

If Python is available, it will show you a message with the version details.

Download and Install Python

Open the below official Python download page.

How to locate Python set up
How to locate Python set up

At the top, you should see the current stable version. Click on the download link. If you are looking for any specific version, scroll down on this page and download the specific version under the label “Python releases by version number:”.

After downloading, go to the Downloads folder and run the setup.

Follow the on-screen instructions to install it.

Install Python step 1
Install Python step 1
Install Python step 2
Install Python step 2

After installation is complete, verify the Python version.

Verify Python Version

From the start menu, open “command prompt” and run the following command.

python --version
Python version on Windows
Python version on Windows

You should see your system’s currently installed version of the Python package. Alternatively, you can also run below to get a Python interactive shell.

python

You can exit the shell using CTRL+Z and Enter.

Check PATH Variables

You should check the system variable PATH with the Python executable location. This should be updated automatically using the installer.

From the start menu, search “system variables” and open it.

Open Environment variable Settings
Open Environment variable Settings

In the System Properties Dialog, click on Advanced > Environment Variables. Under the user variables section against the Path variable, check whether the Python installed location is present. Refer to the below image for a guideline.

If you see all the path is present, you are all set to run your Python project.

Check Python Environment PATH Values in Windows
Check Python Environment PATH Values in Windows

Create and run your first Python program

For an additional step, here’s how you can code & run your first Python program. You should ideally use any recommended Python editor to write your program.

Here’s a simple program which outputs the text “debugpoint.com” in the console.

# Sample Python program
print("debugpoint.com")

Save the file with any name. Here I have saved it as “hello.py” in E drive. The .py is the extension of Python source codes.

To run this program, open a command prompt and execute below inside E drive.

python hello.py

Output:

Running a simple Python program in Windows
Running a simple Python program in Windows

Closing Notes

I hope this simple beginner’s guide helps you to install Python in Windows, verify the installation and run your first program.

Please let me know if you run into issues in the comment box below.


Arindam

Creator and author of debugpoint.com. Connect with me via Telegram, 𝕏 (Twitter), or send us an email.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments