How To Install Python on Windows | phoenixNAP KB (2024)

Introduction

Python is a widely used high-level programming language. It is one of the most popular and flexible server-side programming languages.

Windows does not have the Python programming language installed by default. However, you can install Python on Windows in just a few easy steps.

This guide provides step-by-step instructions to install and set up Python on Windows.

How To Install Python on Windows | phoenixNAP KB (1)

Prerequisites

  • A system running Windows 10 with administrator access.
  • Access to the command prompt.
  • Access to a web browser.

Python Installation on Windows

The installation requires downloading the official Python .exe installer and running it on your system. The sections below will explain several options and details during the installation process.

Step 1:Select Python Version

Deciding on a version depends on what you want to do in Python. The two major versions are Python 2 and Python 3. Choosing one over the other might be better depending on your project details. If there are no constraints, choose whichever one you prefer.

We recommend Python 3, as Python 2 reached its end of life in 2020. Download Python 2 only if you work with legacy scripts and older projects. Also, choose a stable release over the newest since the newest release may have bugs and issues.

Step 2: Download Python Executable Installer

Start by downloading the Python executable installer for Windows:

1. Open a web browser and navigate to the Downloads for Windows section of the official Python website.

2. Locate the desired Python version.

How To Install Python on Windows | phoenixNAP KB (2)

3. Click the link to download the file. Choose either the Windows 32-bit or 64-bit installer.

The download is approximately 25MB.

Step 3:Run Executable Installer

The steps below guide you through the installation process:

1. Run the downloaded Python Installer.

2. The installation window shows two checkboxes:

  • Admin privileges. The parameter controls whether to install Python for the current or all system users. This option allows you to change the installation folder for Python.
  • Add Python to PATH. The second option places the executable in the PATH variable after installation. You can also add Python to the PATH environment variable manually later.
How To Install Python on Windows | phoenixNAP KB (3)

For the most straightforward installation, we recommend ticking both checkboxes.

3. Select the Install Now option for the recommended installation (in that case, skip the next two steps).

To adjust the default installation options, choose Customize installation instead and proceed to the following step.

How To Install Python on Windows | phoenixNAP KB (4)

The default installation installs Python to C:\Users\[user]\AppData\Local\Programs\Python\Python[version] for the current user. It includes IDLE (the default Python editor), the PIP package manager, and additional documentation. The installer also creates necessary shortcuts and file associations.

Customizing the installation allows changing these installation options and parameters.

4. Choose the optional installation features. Python works without these features, but adding them improves the program's usability.

How To Install Python on Windows | phoenixNAP KB (5)

Click Next to proceed to the Advanced Options screen.

5. The second part of customizing the installation includes advanced options.

Choose whether to install Python for all users. The option changes the install location to C:\Program Files\Python[version]. If selecting the location manually, a common choice is C:\Python[version] because it avoids spaces in the path, and all users can access it. Due to administrative rights, both paths may cause issues during package installation.

Other advanced options include creating shortcuts, file associations, and adding Python to PATH.

How To Install Python on Windows | phoenixNAP KB (6)

After picking the appropriate options, click Install to start the installation.

6. Select whether to disable the path length limit. Choosing this option will allow Python to bypass the 260-character MAX_PATH limit.

How To Install Python on Windows | phoenixNAP KB (7)

The option will not affect any other system settings, and disabling it resolves potential name-length issues. We recommend selecting the option and closing the setup.

Step 4: Add Python to Path (Optional)

If the Python installer does not include the Add Python to PATH checkbox or you have not selected that option, continue in this step. Otherwise, skip to the next step.

Adding the Python path to the PATH variable alleviates the need to use the full path to access the Python program in the command line. It instructs Windows to review all the folders added to the PATH environment variable and to look for the python.exe program in those folders.

To add Python to PATH, do the following:

1. In the Start menu, search for Environment Variables and press Enter.

How To Install Python on Windows | phoenixNAP KB (8)

2. Click Environment Variables to open the overview screen.

How To Install Python on Windows | phoenixNAP KB (9)

3. Double-click Path on the list to edit it.

How To Install Python on Windows | phoenixNAP KB (10)

Alternatively, select the variable and click the Edit button.

4. Double-click the first empty field and paste the Python installation folder path.

How To Install Python on Windows | phoenixNAP KB (11)

Alternatively, click the New button instead and paste the path.

5. Click OK to save the changes. If the command prompt is open, restart it for the following step.

Step 5: Verify Python Was Installed on Windows

The first way to verify that Python was installed successfully is through the command line. Open the command prompt and run the following command:

python --version
How To Install Python on Windows | phoenixNAP KB (12)

The output shows the installed Python version.

The second way is to use the GUI to verify the Python installation. Follow the steps below to run the Python interpreter or IDLE:

1. Navigate to the directory where Python was installed on the system.

2. Double-click python.exe (the Python interpreter) or IDLE.

3. The interpreter opens the command prompt and shows the following window:

How To Install Python on Windows | phoenixNAP KB (13)

Running IDLE opens Python's built-in IDE:

How To Install Python on Windows | phoenixNAP KB (14)

In both cases, the installed Python version shows on the screen, and the editor is ready for use.

Step 6: Verify PIP Was Installed

To verify whether PIP was installed, enter the following command in the command prompt:

pip --version

If it was installed successfully, you should see the PIP version number, the executable path, and the Python version:

How To Install Python on Windows | phoenixNAP KB (15)

PIP has not been installed yet if you get the following output:

'pip' is not recognized as an internal or external command,Operable program or batch file.

If an older version of Python is installed or the PIP installation option is disabled during installation, PIP will not be available. To install PIP, see our article How to Install PIP on Windows.

Step 7: Install virtualenv (Optional)

Python software packages install system-wide by default. Consequently, whenever a single project-specific package is changed, it changes for all your Python projects.

The virtualenv package enables making isolated local virtual environments for Python projects. Virtual environments help avoid package conflicts and enable choosing specific package versions per project.

To install virtualenv, run the following command in the command prompt:

pip install virtualenv
How To Install Python on Windows | phoenixNAP KB (16)

Wait for the installation to complete. Once done, it is installed on the system and available for use.

Note: Learn more about Windows Package Manager's winget command by refering to our article winget upgrade - How to Update Packages.

Conclusion

In this tutorial, we described how to install Python on Windows. The process is similar for all Python versions.

If you already have Python installed and want to update to a newer version, check out our article on how to upgrade Python.

As an expert in Python programming and software installation on Windows, I can assure you that the information provided in the article is accurate and comprehensive. Let me break down the concepts used in the article to further enhance your understanding:

  1. Python Versions:

    • The article mentions two major versions of Python: Python 2 and Python 3. It recommends using Python 3, as Python 2 reached its end of life in 2020. The choice between versions depends on project requirements.
  2. Downloading Python Installer:

    • To install Python on Windows, the official Python .exe installer needs to be downloaded. The article guides users to the Downloads for Windows section of the Python website, where they can choose the desired version and download the installer.
  3. Running the Executable Installer:

    • The installation process involves running the downloaded Python Installer. Users are presented with options such as choosing the installation folder, adding Python to PATH, and installing for the current user or all system users.
  4. Customizing Installation:

    • Users have the option to customize the installation by choosing features such as IDLE (Python editor), the PIP package manager, and additional documentation. Advanced options include installation for all users, creating shortcuts, file associations, and adding Python to PATH.
  5. Disabling Path Length Limit:

    • An optional step involves choosing whether to disable the path length limit, allowing Python to bypass the 260-character MAX_PATH limit. This can be beneficial to avoid potential name-length issues.
  6. Adding Python to PATH (Optional):

    • The article explains how to add Python to the PATH environment variable manually if it wasn't done during the installation. This step is useful for accessing Python from any command prompt window without specifying the full path.
  7. Verifying Python Installation:

    • Users are guided on how to verify a successful Python installation through the command line by running python --version. The article also mentions an alternative method using the GUI, either by running the Python interpreter or IDLE.
  8. Verifying PIP Installation:

    • The article instructs users on how to verify the installation of PIP (Python Package Installer) using the command pip --version. This ensures that PIP is available for managing Python packages.
  9. Installing virtualenv (Optional):

    • For creating isolated virtual environments, the article introduces the optional step of installing virtualenv. This allows users to manage project-specific package versions and avoid conflicts.
  10. Conclusion:

    • The tutorial concludes by summarizing the installation process and noting that it applies similarly to all Python versions. It also mentions that users can refer to another article on upgrading Python if they already have it installed and want to update to a newer version.

In summary, this article provides a comprehensive guide for installing and setting up Python on Windows, catering to both beginners and experienced developers.

How To Install Python on Windows | phoenixNAP KB (2024)

FAQs

How To Install Python on Windows | phoenixNAP KB? ›

To install Python using the Microsoft Store: Go to your Start menu (lower left Windows icon), type "Microsoft Store", select the link to open the store. Once the store is open, select Search from the upper-right menu and enter "Python". Select which version of Python you would like to use from the results under Apps.

How do I install Python on Windows? ›

To install Python using the Microsoft Store: Go to your Start menu (lower left Windows icon), type "Microsoft Store", select the link to open the store. Once the store is open, select Search from the upper-right menu and enter "Python". Select which version of Python you would like to use from the results under Apps.

How do I install a .PY file in Windows? ›

4 Steps to Install Python on Windows 10
  1. Go to Python's website and download the latest version of Python.
  2. Select “Windows installer” and click download.
  3. Follow the on-screen instructions.
  4. Verify the installation by opening a command prompt and typing: python -V .
Sep 14, 2023

How to install Python 3.10 on Windows 10? ›

Installing Python 3 on Windows 10 and 11
  1. Open a browser to the Python website and download the Windows installer. ...
  2. Double click on the downloaded file and install Python for all users, and ensure that Python is added to your path. ...
  3. After the installation is complete, click Disable path length limit and then Close.
Jun 19, 2023

How do I install Python on Windows app? ›

To uninstall Python from Windows using the control panel, follow the steps given below:
  1. Open the Control Panel. You can do this by searching for “Control Panel” in the Start menu.
  2. Click on “Programs and Features”. ...
  3. In the list of installed programs, find Python.
  4. Right-click on Python and choose “Uninstall”.

Is Python automatically installed on Windows? ›

Unlike most Unix systems and services, Windows does not include a system supported installation of Python. To make Python available, the CPython team has compiled Windows installers with every release for many years.

Why can't i install Python on my Windows? ›

The Python setup may fail if you don't have Windows Service Pack 1 (SP1) installed on your computer. It is a requirement for installing Python. Download Windows Service Pack 1. If it states an unspecified error, try downloading KB2999226.

How to check if Python is installed in Windows? ›

To check if Python is installed on your Windows machine using the Start Menu, follow these steps: Press the Windows key or click on the Start button to open the Start Menu. Type "python". If Python is installed, it should show up as the best match.

How to run Python in Windows? ›

To run Python scripts with the python command, you need to open a command-line window and type in the word python followed by the path to your target script: Windows.

How to install setup py in Windows 10? ›

Installing Python Packages with Setup.py

To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.

Where should I Install Python? ›

Python installs on Windows in much the same way as any other application, by way of an installer that guides you through the setup process. By default, the Python installer for Windows places its executables in the user's AppData directory, so that it doesn't require administrative permissions.

How do I add Python to a Windows path? ›

How to Add Python to PATH on Windows
  1. Step 1: Find Python Installation Directory. Before modifying the PATH variable, find the Python installation directory. ...
  2. Step 2: Locate PATH Variable Options. ...
  3. Step 3: Add Python Directory to PATH.
Dec 28, 2023

How do I install Python app on Windows? ›

  1. Step 1: Select Python Version.
  2. Step 2: Download Python Executable Installer.
  3. Step 3: Run Executable Installer.
  4. Step 4: Add Python to Path (Optional)
  5. Step 5: Verify Python Was Installed on Windows.
  6. Step 6: Verify PIP Was Installed.
  7. Step 7: Install virtualenv (Optional)
Dec 5, 2023

How to install Python on Windows and pip? ›

Pip is usually included automatically when installing Python on Windows. To ensure it's installed, download Python from python.org and select the ” Add Python to PATH ” option during installation. Then, open Command Prompt (cmd) and type python -m ensurepip –upgrade to install or upgrade pip.

Can I download Python for free? ›

Yes. Python is a free, open-source programming language that is available for everyone to use. It also has a huge and growing ecosystem with a variety of open-source packages and libraries. If you would like to download and install Python on your computer you can do for free at python.org.

Which Python version is best? ›

  • Definitely start with Python3! It's simple when you consider why each version is used.
  • Python3 is being used because it is the better Python dialect. ...
  • I'm writing code for python 2.3–2.7 and 3.2–3.7 and from my experience, Python3 is just more fun. ...
  • Advocates of Python2.7 will tell you that it's faster.
Jan 27, 2023

Top Articles
Keep your info safe: How to file your taxes securely
G4 LED Light Bulbs - Open Lighting Product Directory (OLPD)
Encore Atlanta Cheer Competition
Woodward Avenue (M-1) - Automotive Heritage Trail - National Scenic Byway Foundation
Top 11 Best Bloxburg House Ideas in Roblox - NeuralGamer
Design215 Word Pattern Finder
Odawa Hypixel
Obor Guide Osrs
Booknet.com Contract Marriage 2
Ymca Sammamish Class Schedule
How Many Cc's Is A 96 Cubic Inch Engine
THE 10 BEST Women's Retreats in Germany for September 2024
Displays settings on Mac
Big Y Digital Coupon App
Milk And Mocha GIFs | GIFDB.com
Space Engineers Projector Orientation
Shariraye Update
Ree Marie Centerfold
Readyset Ochsner.org
Socket Exception Dunkin
Kaomoji Border
Craiglist Galveston
065106619
London Ups Store
Second Chance Maryland Lottery
Https Paperlesspay Talx Com Boydgaming
Qhc Learning
Rochester Ny Missed Connections
Conscious Cloud Dispensary Photos
Sound Of Freedom Showtimes Near Movie Tavern Brookfield Square
Democrat And Chronicle Obituaries For This Week
Pokémon Unbound Starters
Darknet Opsec Bible 2022
Nikki Catsouras: The Tragic Story Behind The Face And Body Images
Street Fighter 6 Nexus
Gasbuddy Lenoir Nc
Sports Clips Flowood Ms
RUB MASSAGE AUSTIN
Laurin Funeral Home | Buried In Work
Whitehall Preparatory And Fitness Academy Calendar
Natashas Bedroom - Slave Commands
20 Best Things to Do in Thousand Oaks, CA - Travel Lens
Download Diablo 2 From Blizzard
Panorama Charter Portal
2132815089
Best GoMovies Alternatives
Unlock The Secrets Of "Skip The Game" Greensboro North Carolina
Southwest Airlines Departures Atlanta
Whitney Wisconsin 2022
City Of Irving Tx Jail In-Custody List
Lightfoot 247
What Are Routing Numbers And How Do You Find Them? | MoneyTransfers.com
Latest Posts
Article information

Author: Msgr. Refugio Daniel

Last Updated:

Views: 5522

Rating: 4.3 / 5 (74 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Msgr. Refugio Daniel

Birthday: 1999-09-15

Address: 8416 Beatty Center, Derekfort, VA 72092-0500

Phone: +6838967160603

Job: Mining Executive

Hobby: Woodworking, Knitting, Fishing, Coffee roasting, Kayaking, Horseback riding, Kite flying

Introduction: My name is Msgr. Refugio Daniel, I am a fine, precious, encouraging, calm, glamorous, vivacious, friendly person who loves writing and wants to share my knowledge and understanding with you.