The best way to install Python through Windows Command Prompt will be through Chocolatey (Windows Package Manageer).

Steps to install python 3 will be as follows :-

  1. Open CMD using 'Run as Administrator'.

  2. Download and Install Chocolatey using the following command.

Copy@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
  1. Download and install python using the following command.
choco install -y python3
  1. You can check the version to verify if Python was successfully installed as follows.
Copypython --version
Answer from Cyborg on Stack Overflow
Top answer
1 of 6
33

The best way to install Python through Windows Command Prompt will be through Chocolatey (Windows Package Manageer).

Steps to install python 3 will be as follows :-

  1. Open CMD using 'Run as Administrator'.

  2. Download and Install Chocolatey using the following command.

Copy@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
  1. Download and install python using the following command.
choco install -y python3
  1. You can check the version to verify if Python was successfully installed as follows.
Copypython --version
2 of 6
22

You could download the setup you want to install and then install it automatically without using the setup's UI:

Copy[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Invoke-WebRequest -Uri "https://www.python.org/ftp/python/3.7.0/python-3.7.0.exe" -OutFile "c:/temp/python-3.7.0.exe"

c:/temp/python-3.7.0.exe /quiet InstallAllUsers=0 InstallLauncherAllUsers=0 PrependPath=1 Include_test=0

I don't think it will work without admin privileges though, I tried using InstallAllUsers=0 to install it only for the current user but it is still asking for elevation.

There are some options you can use when installing it this way, here is the doc: https://docs.python.org/3.6/using/windows.html#installing-without-ui

🌐
Microsoft Learn
learn.microsoft.com › en-us › windows › dev-environment › python
Python on Windows for beginners | Microsoft Learn
April 15, 2026 - Install Python: Install Python from the Microsoft Store. The Microsoft Store version automatically configures your PATH and provides automatic updates. Once installed, open PowerShell and run python --version to verify.
Discussions

Using Powershell to Install Python
Hi all A while ago I created a script in powershell to install python and it worked if I was running the script but then I automated it in Jenkins so it... More on techcommunity.microsoft.com
🌐 techcommunity.microsoft.com
2
0
February 1, 2024
Powershell script to install python and add environment variable and run python commands
Hello Experts, I am trying to automate installation of python and add environment variables and run some python commands. I was able to install python from script and was able to add environment variables, but issue is we need to close and reopen the script to run python commands. is there ... More on community.spiceworks.com
🌐 community.spiceworks.com
2
5
July 1, 2025
Installing Python with Powershell and "System" Account
Hi, I am doing my head in here. I have an installation script that works perfectly for everything through Windows Task Scheduler except Python. It uses the system account on the server to run this task. It doesn't error when installing Python, but what… More on learn.microsoft.com
🌐 learn.microsoft.com
2
0
April 2, 2023
Installing Python with powershell
howdy Not_A_MadScientist, even if you don't want to use choco for some reason, you can use their code as a template for your own. they support using an internal source, so they otta be able to be a handy example, at least. take care, lee More on reddit.com
🌐 r/PowerShell
7
7
May 22, 2018
🌐
Python.org
discuss.python.org › python help
Install python with a script or powershell - Python Help - Discussions on Python.org
January 24, 2024 - Im looking for some help with an install script. We want to push out python to end users in the background via powershell or script. Has anyone had any success with it?
🌐
Python
docs.python.org › 3 › using › windows.html
4. Using Python on Windows — Python 3.14.6 documentation
To install the file downloaded from python.org, either double-click and select “Install”, or run Add-AppxPackage <path to MSIX> in Windows Powershell.
🌐
Stevens
fsc.stevens.edu › installing-python-on-windows-11-workstations
Installing and Using Python on Windows 11 Workstations
April 9, 2025 - It is based on the most common ... to install and use Python environments. Most commands here are done through the terminal. This is to ensure reproducibility and ease of following instructions. To access the terminal on Hanlon Lab machines, search for the Terminal app. If the machine is on Windows 10, Terminal may not be available. In that case, search for PowerShell...
🌐
GitHub
gist.github.com › Daethyra › 66c78005b8e9c8e1dc28dd9e43021596
Python 3.10.11 PowerShell Auto-Installation · GitHub
Save Daethyra/66c78005b8e9c8e1dc28dd9e43021596 to your computer and use it in GitHub Desktop. Download ZIP · Python 3.10.11 PowerShell Auto-Installation · Raw · Py31011_PSAI.ps1 · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below.
Find elsewhere
🌐
Real Python
realpython.com › installing-python
How to Install Python on Your System: A Guide – Real Python
February 18, 2026 - After you’ve selected the Python Install Manager app, follow these steps to complete the installation: Click the Get button. Wait for the app to download. Click the Open button. When you click the Open button, you’ll be presented with a terminal window. Follow the on-screen instructions to complete the installation. Once the installation is complete, open Windows PowerShell and run the python --version command to confirm that Python is installed on your machine.
🌐
DEV Community
dev.to › jajera › install-python-on-windows-via-cli-winget-3lnm
Install Python on Windows via CLI (winget) - DEV Community
September 23, 2025 - Here’s how you can install Python 3 in seconds, entirely from the terminal. Press Win + X → select Windows PowerShell (Admin) or Terminal (Admin). ... Name Id Version ---------------------------------------- Python 3.13 Python.Python.3.13 ...
🌐
Microsoft Community Hub
techcommunity.microsoft.com › microsoft community hub › communities › products › powershell › windows powershell
Using Powershell to Install Python | Microsoft Community Hub
February 1, 2024 - A while ago I created a script in powershell to install python and it worked if I was running the script but then I automated it in Jenkins so it ran remotely on the machine.
🌐
Spiceworks
community.spiceworks.com › programming & development
Powershell script to install python and add environment variable and run python commands - Programming & Development - Spiceworks Community
July 1, 2025 - Hello Experts, I am trying to automate installation of python and add environment variables and run some python commands. I was able to install python from script and was able to add environment variables, but issue is…
🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 1195583 › installing-python-with-powershell-and-system-accou
Installing Python with Powershell and "System" Account - Microsoft Q&A
April 2, 2023 - Does that installer interact with the desktop in any way? The system account has no profile, like a normal user would have, that's accessible. ... You would need to use the equivalent of msiexec's /quiet switch. Maybe I should ask: is the "Python installer" msiexec.exe?
🌐
Coding for Entrepreneurs
codingforentrepreneurs.com › guides › install-python-on-windows
Install Python on Windows - Coding for Entrepreneurs
Coding for Entrepreneurs · Learn · Enroll · Courses · Suggestions · Shorts · Community · Testimonials · Connect
🌐
Bigblue
bigblue.academy › en › how-to-download-python-for-windows-step-by-step
How to Install Python on Windows
June 25, 2023 - Winget is a package manager for Windows programs, included in Windows 11. To install Python via winget, open a terminal such as command line, PowerShell, or Windows Terminal.
🌐
Hexnode
hexnode.com › mobile-device-management › help › script-to-install-python-on-windows-devices
Script to install Python on Windows devices - Hexnode Help Center
May 14, 2024 - This PowerShell script begins by defining variables for the desired Python version and its download URL. The placeholder “version” can be replaced with the specific version number needed. Subsequently, the script defines the installation directory path. Utilizing the Invoke-WebRequest cmdlet, the script downloads the Python installer from the specified URL and saves it in a temporary directory. To ensure a silent installation without any user interface or interaction, the script employs the Start-Process cmdlet with the /quiet argument.
🌐
H2S Media
how2shout.com › home › developer › 2 ways to install latest python on windows 11 or 10 – gui & cmd
2 Ways to install latest Python on Windows 11 or 10 – GUI & CMD
January 18, 2023 - Especially, for those who are not ... interpreted programming language. ... Installing Python 3 on Windows 10 or 111. Download Python’s latest version2. Start Python Installation on Windows3. Check version4. Stop Python from opening the Microsoft store5. Open PowerShell, CMD, or Terminal ...
🌐
Reddit
reddit.com › r/powershell › installing python with powershell
r/PowerShell on Reddit: Installing Python with powershell
May 22, 2018 -

I am playing around with powershell and looking for a way to efficiently install versions of Python with powershell I am trying to make this fully automated. I want to install Python without using chocolately. I did have some code that would grab the binaries and install them.

But I am looking for any other code to optimize my code

Any help is appreciated. Thanks!

🌐
Advantech Cloud IoT Service Portal
advantech-ncg.zendesk.com › hc › en-us › articles › 4404778102669-How-to-install-python3-and-pip-on-Windows-10-11
How to install python3 and pip on Windows 10/11? – Advantech ESG Service Center
March 28, 2025 - In the search of Windows, please enter "Microsoft Store" and press "Enter" key · In the search of "Microsoft Store" and enter "python" then press "Enter" key · Click the python that you want to install. Then click the "Get" to get the preferred version of python. Stay tuned and wait for the installation progress bar completed. Close all PoweShell and re-open a new PowerShell then run the "python -V" or "python --version" to check the installed python version
🌐
Oxylabs
oxylabs.io › blog › how-to-run-python-script-in-powershell
How to Run Python Script in PowerShell
March 20, 2025 - This guide explains how to run Python scripts using the PowerShell command-line interface. It details the process of installing Python, creating a simple script, and executing it from PowerShell, enabling Python's capabilities within the Windows environment for scripting and automation.
🌐
GitHub
gist.github.com › raoshaab › de861c353ab0e0cb77f8afd5325e43c1
Install Python 3 with powershell in windows 10 - Gist - GitHub
# Define the target installation directory i.e $installDir = "D:\newfolder\python3" $installDir = "D:\Python3" # Install Python with specified installation directory Start-Process -FilePath $pythonInstaller -ArgumentList "/quiet PrependPath=1 TargetDir=$installDir" -Wait