Looking to install Python on your Windows machine? winget, a package manager built into Windows, makes this process a breeze. Let's guide you through the steps, from getting started with winget to installing Python seamlessly.

Before we dive in, ensure you're using Windows 10 (version 1903 or later) or Windows 11. These versions come with winget pre-installed, so you're ready to go. Let's explore the world of Python installation using winget.

Understanding Windows Package Manager (winget)
winget is a powerful command-line tool that enables you to easily install software on your Windows machine. It simplifies software installation by automating the process and ensuring stability across different versions of Windows.

In this guide, we'll harness the power of winget to install Python. Let's dive right in and see how it works.
Initializing winget

Although winget comes pre-installed with supported Windows versions, you might need to initialize it for first use. To do this, open PowerShell as an administrator and run the following command:
winget init -y
This command initializes winget, making it ready to install software.
Installing Python with winget

Now that winget is initialized, we can install Python. Here's how to do it:
- Open PowerShell as an administrator.
- Run the following command to search for Python packages available through winget:
winget search python
This command lists Python packages that winget can install.

- Once you've found the desired Python package (e.g.,
python:3.9), run the following command to install it:
winget install python:3.9
The installation process begins. Once complete, you'll have Python installed on your Windows machine using winget.









Verifying the Python Installation
After installing Python via winget, it's a good idea to verify that everything is working as expected. Here's how:
Checking Python Version
Open your command prompt or PowerShell and type the following command:
python --version
If Python is installed correctly, you'll see the installed version displayed (e.g., Python 3.9.7).
Running Python in Interactive Mode
To ensure your Python installation is working properly, try running Python in interactive mode:
python
You should see the classic Python interactive mode greeting (e.g., >> or >>>). Now you're ready to start coding in Python!
That's it! You've successfully installed Python on your Windows machine using the winget package manager. Happy coding!