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

🌐
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?
Discussions

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
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
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
How can I run Python 2 in Powershell when I have both Python 2 and 3 installed?
Doesn't just py -2 work? More on reddit.com
🌐 r/Python
10
0
June 28, 2016
🌐
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.
🌐
GitHub
gist.github.com › raoshaab › de861c353ab0e0cb77f8afd5325e43c1
Install Python 3 with powershell in windows 10 · GitHub
# Download the latest version of Python from the official website $pythonUrl = "https://www.python.org/ftp/python/3.10.0/python-3.10.12-amd64.exe" $pythonInstaller = "$($env:TEMP)\python.exe" Invoke-WebRequest -Uri $pythonUrl -OutFile $pythonInstaller # Install Python with default settings Start-Process -FilePath $pythonInstaller -ArgumentList "/quiet" -Wait # Add Python to the PATH environment variable $pythonPath = Join-Path $env:ProgramFiles "Python310" [System.Environment]::SetEnvironmentVariable("Path", "$($env:Path);$pythonPath", "User") # Verify the installation python --version
🌐
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 - Setting up Python on Windows no ... install Python 3 in seconds, entirely from the terminal. Press Win + X → select Windows PowerShell (Admin) or Terminal (Admin)....
🌐
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…
🌐
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!

Find elsewhere
🌐
Real Python
realpython.com › installing-python
How to Install Python on Your System: A Guide – Real Python
February 18, 2026 - Then click Install. That’s it! You now have the latest version of Python on your Windows machine! If you’re curious to know where the installation is located, then use the where.exe command in PowerShell:
🌐
Note
note.com › トップ › コンピュータ・it › os › 【超初心者向け】powershellの第一歩からpython導入まで
[For Absolute Beginners] From the First Steps of PowerShell to Installing Python|yamator
October 19, 2025 - python -m venv .venv # 作成(.venv フォルダ) .\.venv\Scripts\Activate.ps1 # 有効化(プロンプトに "(.venv)") pip install requests # 以降の pip はこの venv に入る python .\app.py # 実行はこの venv の python deactivate # 終了(元に戻す) ... About .ps1 Activate.ps1 is a **PowerShell script (extension .ps1)**. It is a text file containing a sequence of PowerShell commands; when executed, it switches your current PowerShell session to a state where it "uses the Python for this project."
🌐
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.
🌐
Soldering Mind
solderingmind.com › home › basic electronics › installing python on windows powershell
Installing and Using Python on Windows PowerShell
July 5, 2024 - A: Yes, you can use pip to install Python packages on PowerShell. If you installed Python using the official installer from the Python website, pip should be installed by default.
🌐
Utho
utho.com › docs › windows › how-to-install-python-3-7-on-windows-server-2012-r2-2016-2019-2022-via-powershell
Utho Cloud Documentation
Comprehensive documentation for Utho Cloud — deploy, manage, and scale your cloud infrastructure with ease.
🌐
Bigblue
bigblue.academy › en › how-to-download-python-for-windows-step-by-step
How to Install Python on Windows
June 25, 2023 - To install Python via winget, open a terminal such as command line, PowerShell, or Windows Terminal. Then, run the command "winget search Python.Python" to see the available Python versions.
🌐
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. To run Python scripts, most commonly, you can use:
🌐
Educative
educative.io › answers › how-to-install-pip-on-windows
How to install pip on Windows
For example, to install the popular ... as an administrator. To do this, right-click the “Start” button and choose “Windows PowerShell (Admin),” or “Command Prompt (Admin).”...
🌐
Voidynullness
voidynullness.net › blog › 2014 › 06 › 19 › install-python-setuptools-pip-virtualenvwrapper-for-powershell-pyside-on-windows
How to install a Python development environment on Windows - voidynullness
After installing Python, make sure running scripts is enabled in PowerShell: ... If the Python installer didn’t add the location of Python to the system path, you will need to do that yourself. I did that by creating file called profile.ps1 in ~/Documents/WindowsPowerShell and added the Python install path to $env:Path.
🌐
Delft Stack
delftstack.com › home › howto › powershell › install python with powershell
How to Install Python With PowerShell | Delft Stack
February 2, 2024 - $env:chocolateyProxyLocation = 'https://local/proxy/server' $env:chocolateyProxyUser = 'username' $env:chocolateyProxyPassword = 'password' The steps commonly fix the issue, but if it persists, you may read more on the provided troubleshooting guide here. ... Once the process is completed, we can verify our Python installation using its version by running the command below. If it yields an output, we have successfully installed Python using PowerShell. ... Enjoying our tutorials? Subscribe to DelftStack on YouTube to support us in creating more high-quality video guides.
🌐
Advanced Installer
advancedinstaller.com › execute-python-script-through-powershell.html
Executing Python Scripts through PowerShell: A Step-by-Step Guide
February 22, 2024 - This script uses the `sys` module to access command-line arguments passed to the script. The script then prints the first argument (`sys.argv[1]`). You can also check how to deploy and run a Python script on a Windows 10, 64-bit machine that doesn’t have Python installed. To execute this Python script from PowerShell...
🌐
Code2care
code2care.org › home › howto › how to install python3 on windows using powershell
How to Install Python3 on Windows using PowerShell | Code2care
July 22, 2023 - Start-Process -Wait -FilePath $pythonSetup -ArgumentList "/quiet", "PrependPath=1" # Step 5: Remove the setup file (Optional) Remove-Item -Path $pythonSetup · Facing issues? Have questions? Post them here! We're happy to help! Load Comments · We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better! ... Thanks for your feedback! If you have time, please provide details by selecting options below. ... PowerShell on Mac: The term get-service is not recognized as a name of a cmdlet, function, script file, or executable program2 years ago
🌐
Dataquest
dataquest.io › blog › installing-python-on-windows
How to Install Python on Windows, from Downloading to Running Scripts (2022)
March 14, 2025 - To do so, open the command line application Command Prompt (in Windows search, type cmd and press Enter) or Windows PowerShell (right-click on the Start button and select Windows PowerShell) and type there python -V.