[New-bugs-announce] [issue41800] Python installation fails when run under system account if there is already an existing installation on the system already

Jurko Gospodnetić report at bugs.python.org
Thu Sep 17 03:49:13 EDT 2020


New submission from Jurko Gospodnetić <jurko.gospodnetic at gmail.com>:

This issue seems to affect all Python 3 Windows installers.

Reproduced on:
- various Windows 10 systems
- one Windows 8 system
- one Windows 7 system
- all tested Python 3+ installers up to and including 3.8.5

Scenario:
1. there is already an existing Python 3+ installation on a Windows system, installed for all users
2. you run a Python 3+ installer (any version, even the one matching the already installed Python version) under the `systemprofile` Windows user account, targeting all users and the same target folder that the currently existing installation is located in
- example how to do this manually:
    - using the Microsoft/SysInternals `psexec` utility to open a command prompt running under the `systemprofile` Windows user account:
      `psexec -i -s cmd`
    - run the Python installer from that command-prompt, in our case it was the following command:
      `python-3.8.5.exe /passive TargetDir=C:\Python38 InstallAllUsers=1 PrependPath=1`
3. result will be any of the following at random:
- failed installation with different Windows error codes, including totally opaque 0x80070643 `Fatal Error during installation`
- successful installation
- seemingly successful installation that does not really install all the Python components, e.g. the whole `Lib` folder may end up being empty
- seemingly successful installation that then can not be uninstalled as the uninstaller reports that it can not find the existing installation on the system
  - this effect can often, but not always, be fixed by rerunning the installer and then running the uninstaller
    - you can run the uninstaller from the command-line using something like:
      `python-3.8.5.exe /uninstall /passive`

Additional notes on produced results:
- each installation seems to generate differently named log files in the `C:\Windows\Temp` folder, i.e. the `systemprofile` user account's `%TEMP%` folder
- the log file names indicate whether each specific component is being installed for the current-user or all-user variants, and those seem to be chosen at random in our problematic scenario
- it seems like the components whose log files are marked as being installed for the current user are not getting installed at all, or may possibly be getting installed to some other undisclosed location

The same does not occur if any of the following is true:
- if the installation is run from an regular end-user account
- if there is no Python currently installed on the system

A workaround we found in our case (Python gets installed as a step in one of our installers) is to basically do (uninstall, install) in a loop with some hand-crafted checking to see if the existing installation is ok (includes running some Python code + checking for some specific Python distribution files we've found to be missing in some scenarios).

----------
components: Installation
messages: 377039
nosy: Jurko.Gospodnetić
priority: normal
severity: normal
status: open
title: Python installation fails when run under system account if there is already an existing installation on the system already
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41800>
_______________________________________


More information about the New-bugs-announce mailing list