Message377449
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:53 | forrestshields2 | set | recipients:
+ forrestshields2, paul.moore, tim.golden, docs@python, zach.ware, eryksun, steve.dower, John Palermo |
2020-09-24 16:01:53 | forrestshields2 | set | messageid: <1600963313.82.0.0115189653783.issue24757@roundup.psfhosted.org> |
2020-09-24 16:01:53 | forrestshields2 | link | issue24757 messages |
2020-09-24 16:01:53 | forrestshields2 | create | |
|