Sign In
Sign In

How to Install Python on Windows

How to Install Python on Windows
Awais Khan
Technical writer
Python Windows
01.10.2024
Reading time: 6 min

Python is one of the most talked-about programming languages today, widely used by developers and administrators alike. This language is found everywhere. Even for those who are not software engineers, it is important to understand how to install Python on Windows and start using it. 

This article will walk users through the entire process of installing Python on Windows. Let’s dive in and explore it together.

Introduction to Python

Python is a robust, high-level, interpreted programming language that makes the code readability easy and simple. Its syntax allows developers to express their concepts in fewer lines of code unlike other languages, such as Java or C++. Python also supports multiple programming methods, like object-oriented, functional programming or procedural. This makes it an ideal choice for the programmer to do various types of projects with ease. 

Downloading Python for Windows

To perform Python installation on Windows, first download the installer file from the official website using the following steps:

Step 1: Navigate to the Python Download Page

  1. Open any browser on the Windows system. 

  2. Then, visit the official Python download page.

Image1

Step 2: Download Python

  1. Click on the “Download Python” button to download the latest version of Python for Windows.

Image3

  1. The users can also scroll down and select the desired Python version to download on their Windows systems. 

Image2

After completing these steps, an .exe file will be downloaded. This file is the main installer for Python. The whole process is often referred to as a Python language download.

Running the Python Installer

After downloading the installer, follow these steps to install Python from the file:

Step 1: Run the Installer File

  1. Locate the downloaded installer file (.exe), usually found in the Downloads folder. 

  2. After finding the installer file, simply double-click on it to run it. 

Image5

Step 2: Complete the Installation

  1. In the installer window, check the box that says “Add python.exe to PATH” to make it easier to run Python from the command line. 

  2. To make sure the installation has the necessary permissions, also check the box that suggests “Use admin privileges when installing py.exe”. 

  3. Once done, click the “Install Now” button to begin the installation. 

Image4

Step 3 (Optional): Customize the Installation

  1. Users can customize the Python setup for Windows by selecting the “Customize installation” option. Doing this allows them to tailor the installation process to their specific needs.

  2. Go with all features, including the one with the install py launcher to make it easier to start Python. 

  3. Click “Next” after making the desired selections.

Image7

  1. In the Advanced Options, users can check the boxes to download debugging symbols and binaries. This is useful for developers who need to debug their Python applications. 

  2. Apart from that, a different location can also be selected for Python. 

  3. Once done, click the “Install” button.

Image6

Step 4: Wait for Installation

  1. Wait for the installation to complete, since it might take a few minutes.

Image9

Verifying the Installation

Once the installation is complete, verify that Python is installed correctly by following these steps:

  1. Open Command Prompt from the Start Menu by simply searching for “cmd” in the search box.

  2. In the window of the Command Prompt, enter the following command:

python --version
  1. After executing the command, the user will see the version of the Python that was installed on the system. 

Image8

If the above steps have been followed carefully, the user will be able to use Python on Windows without any issues.

If an error message appears, it means that Python was not installed correctly. This may occur if the user forgets to check the box that says “Add python.exe to PATH”. If this happens, an additional method, “Setting Up Python in Windows PATH” must be followed which is given below. 

Setting Up Python in Windows PATH

To set up Python in Windows PATH manually, follow the steps provide below:

Step 1: Run Environment Variables

  1. From the Start Menu, search for “Environment Variables”. 

  2. Then click on the “Edit the system environment variables” option:

Image12

  1. This will open the System Properties Advanced tab:

Image10

Step 2: Open Environment Variables Window

In the System Properties Advanced tab, click on the “Environment Variables” button.

Image11

Step 3: Locate the Path Variable

In the Environment Variables window, navigate to the “Path” variable in the “System variables” section and select it.

Image13

Step 4: Edit the Path Variable

  1. Double-click on the Path option or select the Path option, click on “Edit” to open the Edit environment variables window. 

  2. Once done, simply select the “New” button to add a new entry.

Image14

Step 5: Add Python Installation Directory

  1. In the New entry box, enter the path to the Python installation directory. For example “C:\Users\personal_username\AppData\Local\Programs\Python\Python312\”. 

Image15

  1. Once done, click the “OK” button to save the changes.

Image16

Use the “where python” command on Command Prompt to know where is Python installed on the system.

Testing the Python Installation

To ensure the system completes the Python programming setup, let’s run a simple test.

Open Command Prompt from the Start Menu. Enter the following command to run Python interactive shell:

python

Image17

At the interactive shell, the user can now type Python commands or execute codes to see the output.

Bonus Tips on Python Installation for Windows

The following are some additional tips that can be useful during the installation process:

  1. For an instant Python download, the users can use Microsoft Store to quickly install the InstantPython tool. This tool allows them to develop and execute simple Python programs.

Image18

  1. If the command python3 doesn't work on Windows, it is likely due to the way Python is installed and configured on the system. The simple solution is to move to the Python installation directory and rename the python.exe file to python3.exe. This will fix the issue, and the user will be able to run the python3 command.

  2. For users who prefer using PowerShell, the process to download python or python3 for Windows powershell is straightforward. Simply open the PowerShell as administrator and use the following command:

Invoke-WebRequest -Uri "https://www.python.org/ftp/python/3.12.6/python-3.12.6-amd64.exe" -OutFile "python-3.12.6-amd64.exe"

Summary

Python installation on Windows is a straightforward process that opens up a world of programming possibilities. By following the steps provided in this guide, users can ensure that Python is installed correctly and ready to use. Whether developing web applications, exploring AI, or analyzing data, Python is a must on Windows to enhance productivity and capabilities.

Python Windows
01.10.2024
Reading time: 6 min

Do you have questions,
comments, or concerns?

Our professionals are available to assist you at any moment,
whether you need help or are just unsure of where to start
Email us