Author forrestshields2
Recipients John Palermo, docs@python, eryksun, forrestshields2, paul.moore, steve.dower, tim.golden, zach.ware
Date 2020-09-24.16:01:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
As of 3.8.5 the current shell's PATH is outdated after a commandline system-wide installation.  This makes it very difficult to do a scripted install of Python followed by the `python` or `pip` commands, as they will not be found. In addition to modifying the PATH in the system scope, the PATH should also be modified for the current process (shell).

Here is the WORKAROUND I created and am currently using:

1. Perform the commandline system-wide installation from an Administrative PowerShell prompt.
2. After the installation (but before using `python` or `pip`) rebuild the PATH environment variable for the current process from the concatenation of the PATH environment variables from the System and User scopes (this is how Windows builds the PATH) by using this code:
[Environment]::SetEnvironmentVariable('PATH', [Environment]::GetEnvironmentVariable('PATH', 'Machine') + ';' + [Environment]::GetEnvironmentVariable('PATH', 'User'), 'Process')
Date User Action Args
2020-09-24 16:01:53forrestshields2setrecipients: + forrestshields2, paul.moore, tim.golden, docs@python, zach.ware, eryksun, steve.dower, John Palermo
2020-09-24 16:01:53forrestshields2setmessageid: <>
2020-09-24 16:01:53forrestshields2linkissue24757 messages
2020-09-24 16:01:53forrestshields2create