7

I need to passively install Python in my applications package installation so i use the following:

python-3.5.4-amd64.exe /passive PrependPath=1 

according this: 3.1.4. Installing Without UI I use the PrependPath parameter which should add paths into Path in Windows environment variables.

But it seems not to work. The variables does not take any changes.

If i start installation manually and select or deselect checkbox with add into Paths then everything works.

Works same with clear installation also on modify current installation. Unfortunately i do not have other PC with Win 10 Pro to test it.

I have also tried it with Python 3.6.3 with same results.

EDIT:

Also tried with PowerShell Start-Process python-3.5.4-amd64.exe -ArgumentList /passive , PretendPath=1 with same results.

Also tested on several PCs with Windows 10, same results, so the problem is not just on single PC

EDIT: Of cource all attempts were run as administrator.

5
  • but it works for me ... on a windows 7 32bit box. Commented Nov 20, 2017 at 8:49
  • 1
    @georgexsh at Win 10 Pro not. Commented Nov 20, 2017 at 9:15
  • where is your codes ? Commented Nov 20, 2017 at 9:41
  • @IvanBarayev what code? Commented Nov 20, 2017 at 9:44
  • Still bugged Python 3.8 Commented Oct 20, 2020 at 16:03

5 Answers 5

3

Ok, from my point of view it seems to be bug in Python Installer and I can not find any way how to make it works.

I have founds the following workaround:

Use py.exe which is wrapper for all version of Python on local machine located in C:\Windows so you can run it directly from CMD anywhere thanks to C:\Windows is standard content of Path variable.

py -3.5 -c "import sys; print(sys.executable[:-10])" 

This gives me directory of python 3.5 installation.

And then i set it into Path manually by:

setx Path %UserProfile%";PythonLocFromPreviousCommand 
Sign up to request clarification or add additional context in comments.

Comments

1

try powershell to do that

Start-Process -NoNewWindow .\python.exe /passive 

3 Comments

How can i add the PrependPath=1 argument? Start-Process python-3.5.4-amd64.exe /passive works but at Start-Process python-3.5.4-amd64.exe /passive PrependPath=1 I have got the following error: Start-Process : A positional parameter cannot be found that accepts argument 'PrependPath=1'.
you can try Start-Process -NoNewWindow .\python.exe -ArgumentList passive , PretendPath=1
.\python.exe -ArgumentList PrependPath=1 is what I was looking for. (PrependPath takes a p.)
0

Make sure you are using an elevated command prompt (ie: run as administrator).

Comments

0

Have you tried to use the InstallAllUsers argument. By default it is set >to 0 so try to use it like this (which is the same example from [here][1]):

python-3.6.0.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0 it migth make a difference to use the /quiet over /passive

[1]: https://docs.python.org /3.6/using/windows.html#installing-without-ui "the link you supplied"

To answer Erik Šťastný comment i believe that a good solution to your problem is to package python with your program to make sure that all the required libaries is preinstalled.

1 Comment

it seems there is no difference over /quiet or /passive. InstallAllUsers=1 options is really bad. Because if someone has already installed Python in user profile, then is whole installation aborted before reach end and nothing is changed.
0

I also tried the command line options for the python installer and noticed the same issue as you, and here's the solution I found:

  1. Download the 64-bit installer from here: https://www.python.org/downloads/windows/ (the link is titled "Windows x86-64 executable installer")
  2. Uninstall any current python installation.
    • You can use this command: START python-3.8.3-amd64.exe /uninstall
    • (replace python-3.8.3-amd64.exe with the name of the file you downloaded).
    • (run cmd or your batch file as administrator, by right-clicking, then Run As Administrator).
  3. Install (as admin) python 64-bit for all users, with the START command:
    START python-3.8.3-amd64.exe /passive PrependPath=1 Include_pip=1 InstallAllUsers=1
  4. (Optional) Open a new cmd window to verify that python works from any location:
    • You can run this command:python --version
    • (If you don't see output like "Python 3.8.3", then Python has not been added to your PATH).
    • (Note: That command didn't work until I opened a new command prompt window).

For me, all of the details were important, so don't skip any.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.