If you’re learning to code or setting up a development environment, installing Python is one of the first steps. While most people download it through the official website, you can actually install Python on Windows 11 directly using Command Prompt (CMD) — faster, cleaner, and great for automation.
In this guide, we’ll show you how to install Python using CMD, verify it’s installed correctly, and fix any issues that may appear along the way.
Why Install Python via Command Prompt?
Installing Python through Command Prompt is useful for several reasons. First, it is fully scriptable, which means you can automate the entire installation process using batch files or PowerShell scripts. This makes it especially helpful for setting up multiple systems quickly.
Additionally, it allows you to customize installation options, such as adding Python to the system PATH during setup. This gives you more control over how Python is configured on your system.
Another advantage is that it works well on headless or remote Windows systems where a graphical interface is not available, making it ideal for advanced or remote setups.
Finally, using CMD makes it easier to repair or reinstall Python programmatically later if needed, saving time and effort in the long run.
How to Install Python on Windows 11 Using CMD
Let’s go through the entire process to install Python on Windows 11 using command prompt.
1. Press Windows + S, type cmd.
2. Right-click Command Prompt and select Run as administrator. You’ll need admin privileges for system-wide installation.
3. Use the Windows package manager winget (built into Windows 11):
winget install -e --id Python.Python.3.12

Note: This command installs the latest stable Python 3.12 directly from Microsoft’s trusted repository.
4. If winget isn’t recognized, you can also use curl to download it manually:
curl -o python-installer.exe https://www.python.org/ftp/python/3.12.6/python-3.12.6-amd64.exe
How to Verify the Python Installation
After installation completes, check whether Python is available globally:
python --version
or
py --version
If it returns something like Python 3.12.6, congratulations; Python is successfully installed and working!
If it says “Python is not recognized”, see the troubleshooting section below.
How to Test Python in CMD
Run Python interactively by typing:
python
You should see a prompt like:
Python 3.12.6 (tags/v3.12.6:xxxxxx, 2025) [MSC v.XXXX 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Try typing:
print("Hello, Python on CMD!")

If you see the output, you’re good to go. To exit Python, press Ctrl + Z and hit Enter.
Wrapping Up
Installing Python on Windows 11 using Command Prompt is not only quick but ideal for developers who prefer efficiency and control. When you use winget the process is fully automatable and works even without the graphical setup wizard.
Once installed, don’t forget to test Python and pip, then start building or running your scripts right from the terminal.