Tutorial

How to Install Python on Windows 10

Updated on April 15, 2024
authorauthor

Meghna Gangwar and Andrea Anderson

How to Install Python on Windows 10

Introduction

The Python programming language is an increasingly popular choice for both beginners and experienced developers. Flexible and versatile, Python has strengths in scripting, automation, data analysis, machine learning, and back-end development.

In this tutorial you’ll install Python on Windows 10 using the Python installer for Windows.

Deploy your frontend applications from GitHub using DigitalOcean App Platform. Let DigitalOcean focus on scaling your app. <$>

<$>[note] Note: If you’re interested in learning how to use Windows PowerShell and package managers, and install and set up Python on Windows 10 using a command-line interface, then check out How To Install Python 3 and Set Up a Local Programming Environment on Windows 10.

Note: If you want to use Python for web development, then Microsoft recommends installing Python using the Windows Subsystem for Linux.

Prerequisites

You’ll need a computer running Windows 10 with administrative privileges and an internet connection.

Step 1 — Downloading the Python Installer

  1. Go to the official Python download page for Windows.

  2. Find a stable Python 3 release. This tutorial was tested with Python version 3.10.10.

  3. Click the appropriate link for your system to download the executable file: Windows installer (64-bit) or Windows installer (32-bit).

    Download Python Installer

Step 2 — Running the Executable Installer

  1. After the installer is downloaded, double-click the .exe file, for example python-3.10.10-amd64.exe, to run the Python installer.

  2. Select the Install launcher for all users checkbox, which enables all users of the computer to access the Python launcher application.

  3. Select the Add python.exe to PATH checkbox, which enables users to launch Python from the command line.

    Customize Installation

  4. If you’re just getting started with Python and you want to install it with default features as described in the dialog, then click Install Now and go to Step 4 - Verify the Python Installation. To install other optional and advanced features, click Customize installation and continue.

  5. The Optional Features include common tools and resources for Python and you can install all of them, even if you don’t plan to use them.

    Python Optional Features

    Select some or all of the following options:

    • Documentation: recommended
    • pip: recommended if you want to install other Python packages, such as NumPy or pandas
    • tcl/tk and IDLE: recommended if you plan to use IDLE or follow tutorials that use it
    • Python test suite: recommended for testing and learning
    • py launcher and for all users: recommended to enable users to launch Python from the command line
  6. Click Next.

  7. The Advanced Options dialog displays.

    Python Advanced Options

    Select the options that suit your requirements:

    • Install for all users: recommended if you’re not the only user on this computer
    • Associate files with Python: recommended, because this option associates all the Python file types with the launcher or editor
    • Create shortcuts for installed applications: recommended to enable shortcuts for Python applications
    • Add Python to environment variables: recommended to enable launching Python
    • Precompile standard library: not required, it might down the installation
    • Download debugging symbols and Download debug binaries: recommended only if you plan to create C or C++ extensions

    Make note of the Python installation directory in case you need to reference it later.

  8. Click Install to start the installation.

  9. After the installation is complete, a Setup was successful message displays.

    Python setup was successful

Step 3 — Adding Python to the Environment Variables (optional)

Skip this step if you selected Add Python to environment variables during installation.

If you want to access Python through the command line but you didn’t add Python to your environment variables during installation, then you can still do it manually.

Before you start, locate the Python installation directory on your system. The following directories are examples of the default directory paths:

  • C:\Program Files\Python310: if you selected Install for all users during installation, then the directory will be system wide
  • C:\Users\Sammy\AppData\Local\Programs\Python\Python310: if you didn’t select Install for all users during installation, then the directory will be in the Windows user path

Note that the folder name will be different if you installed a different version, but will still start with Python.

  1. Go to Start and enter advanced system settings in the search bar.

  2. Click View advanced system settings.

  3. In the System Properties dialog, click the Advanced tab and then click Environment Variables.

  4. Depending on your installation:

    • If you selected Install for all users during installation, select Path from the list of System Variables and click Edit.
    • If you didn’t select Install for all users during installation, select Path from the list of User Variables and click Edit.
  5. Click New and enter the Python directory path, then click OK until all the dialogs are closed.

Step 4 — Verify the Python Installation

You can verify whether the Python installation is successful either through the command line or through the Integrated Development Environment (IDLE) application, if you chose to install it.

Go to Start and enter cmd in the search bar. Click Command Prompt.

Enter the following command in the command prompt:

python --version

An example of the output is:

Output
Python 3.10.10

You can also check the version of Python by opening the IDLE application. Go to Start and enter python in the search bar and then click the IDLE app, for example IDLE (Python 3.10 64-bit).

Verify if Python is installed using IDLE app

You can start coding in Python using IDLE or your preferred code editor.

Conclusion

You’ve installed Python on your Windows 10 computer and are ready to start learning and programming in Python. Next, you can write your first program in Python 3 and continue your learning with more Python tutorials.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the authors
Default avatar
Meghna Gangwar

author


Default avatar

Technical Editor


Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?
 
JournalDev
DigitalOcean Employee
DigitalOcean Employee badge
September 28, 2021

Thank you so much…l almost lost my mind, but thanks to the video, l have everything up and running. Thanks once again

- Candace

    JournalDev
    DigitalOcean Employee
    DigitalOcean Employee badge
    May 23, 2021

    Thanks well explained

    - sara

      JournalDev
      DigitalOcean Employee
      DigitalOcean Employee badge
      November 23, 2020

      Also appreciated these instructions for installation! How do I start the “TKinter” GUI that’s included in the Python distribution pls?

      - Max Hugen

        JournalDev
        DigitalOcean Employee
        DigitalOcean Employee badge
        September 7, 2020

        Thanks a bunch buddy, your instructions helped me in installing Python. Keep up the good work!

        - Pradyuman

          JournalDev
          DigitalOcean Employee
          DigitalOcean Employee badge
          August 31, 2020

          Thank you a lot. You have no idea how much you helped me find my path as I begin my new life with python. Whoever you are: I am highly indebted to you.

          - Nusaybah

            JournalDev
            DigitalOcean Employee
            DigitalOcean Employee badge
            August 13, 2020

            Thank you very much for this.

            - Emeka

              JournalDev
              DigitalOcean Employee
              DigitalOcean Employee badge
              August 13, 2020

              Thank you so much for the very nice and easy step by step python installation guide

              - savita

                JournalDev
                DigitalOcean Employee
                DigitalOcean Employee badge
                July 16, 2020

                Thank you so much, really helpful

                - swarupa

                  JournalDev
                  DigitalOcean Employee
                  DigitalOcean Employee badge
                  July 9, 2020

                  Yes, thanks so much for these instructions. Well written, good choice of graphics of dialogue boxes that pop up during install, nice discussion of path and environmental variables.

                  - Carol

                    JournalDev
                    DigitalOcean Employee
                    DigitalOcean Employee badge
                    July 7, 2020

                    Was really helpful in installing python as a first time user, I was able to easily install with this help.

                    - Pratheeksha Naresh

                      Try DigitalOcean for free

                      Click below to sign up and get $200 of credit to try our products over 60 days!

                      Sign up

                      Join the Tech Talk
                      Success! Thank you! Please check your email for further details.

                      Please complete your information!

                      Become a contributor for community

                      Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

                      DigitalOcean Documentation

                      Full documentation for every DigitalOcean product.

                      Resources for startups and SMBs

                      The Wave has everything you need to know about building a business, from raising funding to marketing your product.

                      Get our newsletter

                      Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

                      New accounts only. By submitting your email you agree to our Privacy Policy

                      The developer cloud

                      Scale up as you grow — whether you're running one virtual machine or ten thousand.

                      Get started for free

                      Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

                      *This promotional offer applies to new accounts only.