-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Microsoft Store installer !adds /Scripts to user PATH env! #118498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You can pip will also print out the path you need if it installs commands that aren't already on PATH. And in any case, Windows doesn't allow modifying PATH as part of their install technology, because they know how bad an idea it is. We don't really have a choice in this regard. |
Perhaps this workaround should be in the Microsoft Store README? I'm fairly confident if installed via choco, the path would be there, which may confuse folks if they're transitioning. 0 pip apps show to run pip that way. For example, I'm terrible at Python and more of a .NET guy. I simply need a pip app then never have to use Python again. However, I did read the Microsoft Store description to ensure there were no gotcha's. This should really be added. |
Perhaps a better first step would be to define a single Scripts folder that is shared by all Python versions (for non-venv installs, of course). That way there's only one path to add, and we don't have to worry about changing it on every release. I believe this is more like POSIX behaviour (again, for non-venv installs). It would be a fairly simple change to I'd propose making it only affect We'd still want to recommend |
The use case that needs a bit of thinking about is people with multiple Python installs. That's rare, but I don't have a good intuition for how rare (all I can say is that I fall into that category 🙂). Things could get messy if I can |
Me too! Though I do everything with Store installed Python (
[For complete clarity, we're talking about I expect that
Does anyone actually check Besides, if someone does check and the file has been overwritten, shouldn't it show that it's changed? This feels a bit like working as intended.
Yeah, this is the problem, and it's basically common to any file that pip overwrites when installing. My preferred solution to the general problem1 wouldn't work here. I'm actually facing the same issue with #114881, which is largely why that has stalled, despite being (IMHO) the best way forward for PATH management.2 Presumably reinstalling in the other version would fix it, and that's a narrower set of people to document for ("people with multiple Python installs who install global tools in both and sometimes uninstall them from one but still want to use the tool" vs "people with Python who install global tools"). I don't know that there's anywhere we could make this obvious, unfortunately... Footnotes |
pip doesn't install versioned entry points, so no - there's only
It makes sense for uninstall to check hashes and refuse to uninstall if they are incorrect. I don't think pip does this, but it could. And I can't speak for
I'm pretty sure pip either refuses to overwrite files owned by a different package, or if not, then we have an active issue where we are discussing the possibility. I don't know how Unix systems (with shared To be honest, I think that "don't install stuff in the system Python" combined with something like pipx, plus a user-friendly environment manager tool, is the right answer here. The separation of concerns between the core and the packaging community makes it hard to advocate for this, though - I don't see the core team officially recommending pipx any time soon, and environment management is in a huge state of flux at the moment, to an extent because the core offering (the bare bones |
Interesting, I guess I assumed it did because
Last I heard there was an active issue, which has been running for a couple of years. I have big teams at work who regularly install on top of each others' files (semi on purpose), so I'm sure I would've heard something if the behaviour had changed.
Agreed on all counts. Maybe I really just need to get back to my |
Note that there's also pypa/pip#4625 which is viewed as a bug and not a feature, and this proposal would rely on that "bug" as an explicit feature. :) |
Since this gets complicated, I'm mostly just thinking some nice readme documentation, perhaps under troubleshooting or prerequisites? Or a post-install sanity check section (EDIT: I like post-install sanity check section, personally -- right after install section since most attention span drops after install)? |
Only for packages that directly bundle their own scripts. Nothing inherent to that bug (which is the same one I referred to earlier) prevents us from properly handling collisions between console script entry points.
You mean like the message that pip printed out when you installed a script and it found that the directory wasn't on PATH? |
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
Related: sphinx-doc/sphinx#12342
Microsoft Store adds python and pip to path for me -- great
...but not /Scripts, where all pip installs go?
Sure, let me find the path/to/Python/.... ⛔ Cannot, since the Microsoft Store apps are in some encrypted dir I cannot even view. I have to deep google search to find the path:
C:\Users\{user}\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts
I finally add this to user data and my pip installs work.
This feels wildly tedious to not add this to user path during installation. This is not a feature request, but a bug -- what's the point of adding pip to path if you can't use the apps?
CPython versions tested on:
3.10
Operating systems tested on:
Windows
The text was updated successfully, but these errors were encountered: