Forrest Shields <[email protected]> added the comment:
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')
```
----------
components: +Installation
nosy: +forrestshields2
versions: +Python 3.8
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue24757>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com