How to Install Python and Pip on Windows

Updated on 22 April, 2025
How to Install Python and Pip on Windows header image

Python is a high-level general-purpose programming language known for its simplicity, readability, and versatility. Python is used in web development, data science, artificial intelligence, and automation tasks. Python works with PIP, a package installer for managing external libraries and dependencies required in applications depending on your project needs.

This article explains how to install Python and Pip on Windows. You will install Python and manage multiple versions using graphical and terminal-based methods. In addition, you will create isolated development virtual environments to install specific libraries with Pip depending on your project needs.

Prerequisites

Before you begin, you need to:

Install Python on Windows

You can install Python on Windows through multiple methods, including graphical and CLI steps. You can use the Windows store on desktop workstations, the Chocolatey package manager, or download the latest .exe Python package for Windows. Follow the steps below to install Python on Windows using any of the supported methods.

Install Python Using the Microsoft Store

Microsoft Store is the default source for installing Python on Windows desktop workstations. Running python in a Powershell window opens the store to install Python. Follow the steps below to install Python using the Microsoft Store.

  1. Open the Windows start menu, search for Microsoft Store and click Open to launch the store.

  2. Enter python in the search bar and press ENTER.

  3. Select your desired Python version published by the Python Software Foundation.

    Search-Python-MS

  4. Click Get to download and install the Python.

    image.png

  5. Verify that the installation is successful.

  6. Open the Windows start menu, search for Command Prompt and click Open to launch a new terminal window.

  7. Verify the installed Python version on your Windows workstation.

    pwsh
    > python --version
    

    Your output should be similar to the one below:

    Python 3.13.3

Install and Manage Multiple Python Versions

You can install multiple Python versions on Windows, allowing you to run different projects on your workstation. Multiple Python versions enable you to work on different projects that require specific Python versions. You can install multiple Python versions with all supported methods, including Chocolatey, Windows Store, or the Python installer package. Follow the steps below to install and manage multiple Python versions using Chocolatey on your Windows workstation.

  1. Run Windows PowerShell as an administrator.

  2. Install Python 3.12 (if it's not already installed).

    pwsh
    > choco install python312 -y
    
  3. Install additional versions by changing the version suffix in the package name. For example, install Python 3.11.

    pwsh
    > choco install python311 -y
    

    Repeat the above installation steps for every version you'd like to install on your Windows workstation.

Manage Installed Python Versions Using Python Version Launcher

Windows includes the Python Launcher (py) application, which allows you to manage and invoke multiple installed Python versions from the command line. Managing Python versions is useful when working with multiple projects that require different Python versions.

  1. Open a new Windows PowerShell session.

  2. List all installed Python versions.

    pwsh
    > py --list
    

    Your output should be similar to the one below:

    -V:3.13 *        Python 3.13 (64-bit)
    -V:3.12          Python 3.12 (64-bit)
    -V:3.11          Python 3.11 (64-bit)
  3. Run a specific Python version, such as 3.13, using the py launcher to open the Python shell. Replace 3.13 with the target Python version you'd like to access.

    pwsh
    > py -3.13
    
  4. Run a script with a specific Python version. For example, run the hello.py script with Python 3.12.

    pwsh
    > py -3.12 /path/to/your/python/script.py
    
  5. Check the active Python version.

    pwsh
    > py --version
    

    Your output should be similar to the one below:

    Python 3.13.3
    • Open the py.ini file and change the Python defaults option to change the default version on Windows.

      pwsh
      > %USERPROFILE%\AppData\Local\py.ini
      

How to Use Python on Windows

You can use Python on Windows after installing it using any supported method. Running Python programs and commands requires Windows PowerShell or an IDE such as IDLE or VSCode that supports the Python language. You can also run Python directly using the Windows Command Prompt or PowerShell. Follow the steps below to use Python on Windows.

Use Python with the Windows PowerShell
  1. Open the Windows Powershell.

  2. Verify the active Python version.

    pwsh
    > python --version
    
  3. Enter python to open the Python shell.

    pwsh
    > python
    
  4. Print a Greetings from Vultr message using Python.

    python
    >>> print("Greetings from Vultr")
    

    Output:

    Greetings from Vultr
  5. Exit the Python shell.

    python
    >>> exit()
    
  6. Create a test hello.py script to verify that Python has access to the system directories.

    pwsh
    > "print('Greetings from Vultr!')" > hello.py
    
  7. Execute the file using Python.

    pwsh
    > python hello.py
    

Create and Manage Virtual Environments Using Python in Windows

Python virtual environments allow you to manage dependencies for individual projects. This prevents version conflicts between packages required by different applications. Follow the steps below to install the virtualenv module, create and manage virtual environments using Python.

  1. Check the default Python version.

    pwsh
    > python --version
    

    Your output should be similar to the one below:

    Python 3.13.3
  2. Install the virtualenv module using pip for the default Python version.

    pwsh
    > python -m pip install virtualenv
    
    • Specify a Python version, such as python3.12 to install the virtualenv module.

      pwsh
      > python3.12 -m pip install virtualenv
      
  3. Create a new venv virtual environment using the default Python version. Replace venv with your desired virtual environment name.

    pwsh
    > python -m virtualenv venv
    
  4. Activate the venv virtual environment.

    pwsh
    > venv\Scripts\activate
    
    • Verify that your terminal prompt changes to the venv virtual environment.

      pwsh
      (venv) PS C:\path\to\your\project>
      
  5. Use Pip to install a package such as requests in the virtual environment.

    pwsh
    > pip install requests
    
  6. List all installed packages in the virtual environment.

    pwsh
    > pip list
    

    Your output should be similar to the one below:

    Package            Version
    ------------------ ---------
    certifi            2025.1.31
    charset-normalizer 3.4.1
    idna               3.10
    pip                25.0.1
    requests           2.32.3
    urllib3            2.3.0
  7. Deactivate the virtual environment.

    pwsh
    > deactivate
    

Upgrade Pip on Windows

Python's package manager, Pip, is typically included when you install Python through Chocolatey or the official installer. You may need to install or upgrade Pip manually when managing multiple Python versions. Follow the steps below to verify the installed Pip version and upgrade it on your Windows workstation.

  1. Verify the installed Pip version.

    pwsh
    > pip --version
    

    Your output should be similar to the one below:

    pip 24.3.1 from C:\Python313\Lib\site-packages\pip (python 3.13)
  2. Upgrade Pip.

    pwsh
    > python -m pip install --upgrade pip
    
  3. Verify the upgraded Pip version.

    pwsh
    > pip --version
    

    Your output should be similar to the one below:

    pip 25.0.1 from C:\Python313\Lib\site-packages\pip (python 3.13)

Conclusion

You have installed Python and pip on Windows using terminal and graphical-based methods. You can use Python in existing applications, create virtual environments and set up new Python applications with compatible tools, including IDEs and the Windows PowerShell. Visit the Python documentation for more information and configuration options.

Comments

No comments yet.