问题
I installed Python 3.7 via the Windows Store. I have selected this runtime environment in VScode, and VScode insists on nagging me about installing the pylint addon (or another linting addon). It attempts to run this command in a Git Bash terminal (MINGW64):
$ C:/Users/rjamd/AppData/Local/Microsoft/WindowsApps/python.exe -m pip install -U pylint --user
...which is denied permission to run:
bash: C:/Users/rjamd/AppData/Local/Microsoft/WindowsApps/python.exe:
Permission denied
Seems like they didn't really think about the distribution method screwing with permissions!
I should not be getting any permissions issues, because this is attempting to run in my local user directory, which I have full permissions on.
Full permissions are granted to:
- SYSTEM (group)
- rjamd (my user)
- Administrators (group)
Everything appears to be in order.
Update:
- Python will not run at all in the Git bash terminal, but it runs in CMD (without running CMD as admin).
- Git bash cannot find any other instances of Python using
which --all python
. It prints the same executable path twice in a row. I have 3 conda environments, and two different paths for the new Python environment ("AppData" and "Program Files"), all of which show up in VScode's environment selection menu.
回答1:
(Microsoft employee and CPython core developer here).
This is most likely a bug in Git Bash. They are probably trying to read some information from the executable in a way that doesn't handle reparse points correctly (and may not be able to handle Windows symlinks either, in that case).
Launching the executable under AppData
from anywhere else in Windows should be okay, though if you can't launch it with PowerShell or cmd.exe, please use the Windows Feedback tool to report a bug for the team.
来源:https://stackoverflow.com/questions/57447363/cannot-install-pylint-in-git-bash-on-windows-windows-store