How to Install Python on Windows 10

How to Install Python on Windows 10

Python is a programming language gaining popularity among both novices and seasoned developers. Its adaptability and versatility make it a valuable tool for scripting, automation, data analysis, machine learning, and back-end development.

This tutorial will guide you through installing Python on Windows 10 using the dedicated Python installer designed for the Windows operating system.

Requirements

Ensure you have a Windows 10 computer with administrative privileges and an active internet connection.

1) Downloading the Python Installer

Step 1. Go to the official Python download page for Windows. https://www.python.org/downloads/windows/

Downloading the Python Installer

Step 2. Locate a stable release of Python 3. For the purposes of this tutorial, Python version 3.10.10 was utilized during testing.

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

2) Running the Executable Installer

Step 1. Once the installer has been downloaded, double-click the .exe file, such as python-3.10.10-amd64.exe, to initiate the Python installer.

Step 2. Check the box labeled “Install launcher for all users.” This will grant all computer users access to the Python launcher application.

Step 3. Check the option “Add python.exe to PATH.” This will allow users to launch Python directly from the command line.

Running the Executable Installer

Step 4. If you’re new to Python and wish to proceed with the default features outlined in the dialog, click “Install Now” and point 4 – Verify the Python Installation. For additional advanced features, opt for “Customize installation” and proceed accordingly.

Step 5. The Optional Features encompass prevalent tools and resources for Python, and you can install all of them, even if you don’t anticipate utilizing them.

Install Optional Features

Choose any combination of the following options:

  • Documentation: advisable
  • pip: advisable if you intend to install additional Python packages, like NumPy or pandas
  • tcl/tk and IDLE: advisable if you anticipate using IDLE or following tutorials that employ it
  • Python test suite: advisable for testing and learning purposes
  • py launcher and for all users: advisable for enabling command-line access to Python for all users

Step 6. Click Next.

Step 7. The Advanced Options dialog will appear.

Advanced Options

Choose the options that align with your needs:

  • Install for all users: It is advisable if multiple users share this computer
  • Associate files with Python: advisable; this associate all Python file types with the launcher or editor
  • Create shortcuts for installed applications: advisable for convenient application shortcuts
  • Add Python to environment variables: advisable for launching Python
  • Precompile standard library: unnecessary; it may prolong the installation
  • Download debugging symbols and Download debug binaries: advisable only if creating C or C++ extensions is part of your plan. Take note of the Python installation directory, as you may need to refer to it later.

Step 8. Click Install to start the installation.

Step 9. After the installation, a successful Setup message displays.

successful Setup

3) Adding Python to the Environment Variables (optional)

You can skip this step if you choose to include Python in your environment variables during installation.

However, if you wish to access Python from the command line and did not add it to your environment variables during installation, you can perform this manually.

Before proceeding, locate the Python installation directory on your system. The following directories serve as examples of default directory paths:

C:Program FilesPython310: The directory will be system-wide if you choose “Install for all users” during installation.

C:UsersSammyAppDataLocalProgramsPythonPython310: If you didn’t select “Install for all users” during installation, the directory will be in the Windows user path.

Please note that the folder name may vary if you install a different version, but it will still begin with “Python.”

Here’s how to proceed:

Step 1. Open the Start menu and type “advanced system settings” in the search bar.

Step 2. Click on “View advanced system settings.”

Step 3. In the System Properties dialog, go to the Advanced tab and then click “Environment Variables.”

Step 4. Depending on your installation:

  • If you chose “Install for all users” during installation, select “Path” from the list of System Variables and click “Edit.”
  • If you did not select “Install for all users” during installation, select “Path” from the list of User Variables and click “Edit.”

Step 5. Click “New,” enter the path to the Python directory, and then click “OK” until all the dialog boxes are closed.

4) Verify the Python Installation

You can confirm the successful installation of Python via the command line or the Integrated Development Environment (IDLE) application if you opted to install it.

Follow these steps:

Step 1. Open the Start menu and type “cmd” in the search bar. Click on “Command Prompt.”

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


Python --version

An example of the output is Python 3.10.10

You can also verify the Python version by launching the IDLE application. Follow these steps:

Step 1. Open the Start menu and type “python” in the search bar.

Step 2. Click on the IDLE app, such as “IDLE (Python 3.10 64-bit),” that appears in the search results. This will open the IDLE environment.

Step 3. you will see the Python version in the IDLE shell window once the IDLE opens.