Bytes
Data Science

How to Install Python on Windows OS?

Last Updated: 22nd June, 2024
icon

Vibha Gupta

Technical Content Writer at almaBetter

In this blog, learn how to install Python on Windows and the steps to install Python on Windows. You will also learn how to write your first code successfully.

Python is becoming a popular programming language for beginners and experienced developers. Python is a highly flexible and versatile programming language with strengths in scripting, automation, data analysis, Machine Learning, and back-end development. In this blog, you will learn how to install Python in Windows OS.

Prerequisites

There are certain things that you will need before installing Python.

  1. A computer/laptop with admin access
  2. Internet connection

Steps to Install Python on Windows

Follow these steps to learn how to install Python on a Windows laptop or computer.

Step 1: Download Python Installer

a. Go to the official website of Python to download the installer.

b. Select a stable Python 3 release.

c. Click on the link to download the executable files: Windows installer (64-bit) or Windows installer (32-bit)

Install Python

Step 2: Run the Executable File

a. After downloading the installer, double-click the .exe file, such as python-3.11.11-amd64.exe, to launch the Python installation.

b. Click on the “Install launcher for all users” checkbox to allow all computer users to access the Python launcher application.

c. Choose the Add python.exe to PATH checkbox to allow users to start Python from the command line.

d. If you are new to Python and want to install it with the default features given in the popup, click Install Now and go to Step 4 - Verify the Python Installation. To install optional features, click on “Customize Installation” and continue.

e. Optional Features include standard Python tools and resources, which you can install even if you don’t intend to use them.

Optional Features

f. Select some or all of the following checkboxes:

i.  Documentation

ii.  Pip - to install other packages

iii. Python test suite - used for testing and learning

iv. Py launcher - It enables users to open Python via the command line. Users can also install the Python Windows command line.

g. Click on Next.

h. You will see the Advanced options dialog box. Select the appropriate options that you find helpful.

i. Click on Install.

Python Installer Setup in progress

Wait for some time, and the installation will be completed. The dialog box will show a “Setup was successful” message.

Python installer Setup was successful

Step 3: Add Python to the Environment Variables (Optional)

If you have selected “add Python to Environment Variables” during installation, you could skip this step.

If you want to use Python from the command line but did not include Python in your environment variables during installation, you can do it manually.

Locate the Python installation directory or path on your system before you begin. Please note that the folder name will differ if you have installed a different version.

a. Go to Start and search “advanced system setting”.

b. Click “View advanced system setting”.

c. In the System Properties dialog, you will see the “advanced tab”, click on that and then click on Environment Variables.

d. Depending on your installation:

      i. During installation, if you selected Install for all users, choose the Path from the list of System Variables and click on Edit.

      ii. However, if you didn’t select Install for all users during installation, then select Path from the list of User Variables and click on Edit.

      iii. Click on New and enter the Python directory path, then click OK until all the dialog boxes are closed.

Step 4: Verify Python Installation

You can check whether the Python installation was successful using the command line or the Integrated Development Environment (IDLE) tool if you installed it.

Go to the Start menu and select Command Prompt.

In the command prompt, type the following:

Python Command CodeLet’s write a simple program.

Python Command Code example

Learn more with our latest guide "How to Install Matplotlib in Python"

Conclusion

You have successfully learned how to install Python on Windows and have written your first program using Python in the command prompt.

Join our Full Stack Data Science course and learn how to write simple and complex programs with our outcome-oriented classes.

Related Articles

Top Tutorials

  • Official Address
  • 4th floor, 133/2, Janardhan Towers, Residency Road, Bengaluru, Karnataka, 560025
  • Communication Address
  • Follow Us
  • facebookinstagramlinkedintwitteryoutubetelegram

© 2024 AlmaBetter