How to Download Python from Command-Line

Download python from command prompt on windows

You can download using the curl program, if it's installed on your windows machine. Something like:

curl https://www.python.org/ftp/python/3.8.3/python-3.8.3-amd64.exe -o python_install.exe

(or look for the Python version you want at https://www.python.org/downloads/windows/)

Then, you can run:

python_install.exe /quiet

There are also zip file packages you can download from the URL above.

Note that a quiet install may not change your system's PATH, so you may need to locate the directory in which Python was installed, and call the program from there.

How to install Python using Windows Command Prompt

https://docs.python.org/3.6/using/windows.html#installing-without-ui

Installing Without UI: All of the options available in the installer UI
can also be specified from the command line, allowing scripted
installers to replicate an installation on many machines without user
interaction. These options may also be set without suppressing the UI
in order to change some of the defaults.

To completely hide the installer UI and install Python silently, pass
the /quiet option. To skip past the user interaction but still display
progress and errors, pass the /passive option. The /uninstall option
may be passed to immediately begin removing Python - no prompt will be
displayed.

All other options are passed as name=value, where the value is usually
0 to disable a feature, 1 to enable a feature, or a path.

Install Python with cmd or powershell

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

[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 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

Install python from command line and wait till finished

You can use START /WAIT like this:

$ START /WAIT pythoninstall.exe /quiet InstallAllUsers=1 PrependPath=1

How to run python from the terminal if I installed it using Visual Studio?

thanks for replying. I figured out the answer myself, and thought to answer it for anyone in the future who comes across the same issue.

I went into settings->Apps

Find the python installation and click on it, select modify.

Then click on "modify installation" when the python installation repair window opens, then again click on "modify", make sure to select "Add python to path", and also py launcher option also.

That fixed the problem for me.

Thanks, again.

How do I test if Python is installed on Windows (10), and run an exe to install it if its not installed?

All of the comments guided me to the right way to do it.

I used this great working code:

:: Check for Python Installation
python --version 3>NUL
if errorlevel 1 goto errorNoPython

:: Reaching here means Python is installed.
:: Execute stuff...

:: Once done, exit the batch file -- skips executing the errorNoPython section
goto:eof

:errorNoPython
echo.
echo Error^: Python not installed
"C:\Program Files\used\systems\innoventiq\accumanager\required\excutables\python-3.7.3-amd64.exe"

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings

You need to download Python from https://python.org. When in the installation, be sure to check the option that adds Python to PATH.

Python command not working in command prompt

It finally worked!!!

I needed to do things to get it to work

  1. Add C:\Python27\ to the end of the PATH system variable
  2. Add C:\Python27\ to the end of the PYTHONPATH system variable

I had to add these to both for it to work.

If I added any subdirectories, it did not work for some reason.

Thank you all for your responses.



Related Topics



Leave a reply



Submit