-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Unexpected --user behavior since version 23.1 #11982
Comments
Pip 23.1 does not have a default to |
Sure, thanks in advance. Pip 23.0.1 (successful case):
Pip 23.1 (Failing case):
|
So that's your issue. In the failing case, you have a This was caused by
That issue was extensively discussed, but it appears that the case of the Windows Store distribution wasn't known (or wasn't considered). IMO this is a sufficiently serious problem that it requires a bugfix. I'm not sure it's possible to simply revert the change (reverting a merge commit is a bit beyond my git skills!) so we'll need someone to work on a fix ASAP. @pelson as the author of the original change, are you able to look at this? Alternatively, if anyone can tell me the right git incantation to revert #11487, I can do that and we can revisit the feature for a future pip version. Thanks for reporting this @flowmeadow! |
As a quick proof of concept, I've created #11983 to patch out the BASE config. This might form the basis of a minimal fix if we can't find a better solution. |
I also opened python/cpython#103646 to discuss with CPython whether there's a better way than a pre-installed |
Thanks a lot for the analysis. I can confirm that its the Windows Store installation. I remember having a very bad feeling using it. Well, at least this was the first issue that arose in almost two years. |
Generally, I think the Store install should be fine. There's some quirks like this, but they mostly seem to work. And having people use the distribution and report issues like you have is the only way we'll know what needs improving, so your help is appreciated. |
jFYI, this is also impacting |
@abhinavsingh that's nothing to do with this issue. That's the deprecation of |
By the way @flowmeadow, as a temporary workaround, you should be able to set the |
My understanding is that this is the model of Windows Store installs, the base install is in a global space that any specific user may not have permissions to modify, therefore the application must store user specific data in a user space. But unlike Linux distros which manage the whole Python pipeline for the system install such as installing Python packages like Pandas using their own distribution method outside Pip there is no such infrastructure on the Windows Store and users are expected to use Pip install. Maybe a Windows specific exception will need to be made here as it's model of users is not a 1-1 mapping to Unix-like model of users and root anyway. I'm going to ping @zooba just in case he wants to comment here (and maybe correct any misunderstandings). I do wishfully also wonder if the default behavior of installing Python on Windows could in the future switch from the the Windows Store to |
Show me a Linux distro that downloads our installer and runs it with unreliable command line options and I'll consider it (spoiler: no I won't 😉
I've put plenty of explanation on the CPython bug already. My fundamental disagreement is with configurations located in Perhaps I can imagine useful scenarios for files in both |
To be clear, there's no such thing as a " I do agree that it's wrong to have the "base" config come from the same place as the "site" config of the system Python, precisely because as you say it means that the system site config "leaks" into a virtual environment. I think that's a flaw in the design of #9752 which we should fix1. As a general point, I personally don't consider pip's configuration files as intended for distributors - they are for users and site admins to manage. Distributors shouldn't be using them, and very definitely shouldn't be relying on what's in them. If distributors need configuration options, they should discuss that with the pip maintainers and we can see how best to address such a need. But that's just my personal view - I'd be interested if the other @pypa/pip-committers agree with me on that.
I think that's an interesting use case that we should discuss further. It may be a reasonable use for certain types of config. One key difference if a distributor patches source files is that the support burden is squarely on the distributor in that case. One problem with diagnosing this issue was that it took a while to realise that the offending user config wasn't actually set by the user, and the user didn't know about it. Footnotes
|
Same issue here, for now I just reverted back to pip 21.3 and everything worked again. Although, in my case both pip 23.0.1 and pip 23.1 are failing with the same error |
For solution 1 how do u find a file that is higher priority than the base file? I was wondering if its one of these files I will have to change? If it is one of the user or global files, I have tried adding this to the pip.ini, but it did not work:
For solution 2, I tried using |
@pradyunsg As I said above I'd be happy to do that but I don't know how (in git) to revert a merge commit. If you can confirm how I do that I'd be far happier with that approach. On the longer term resolution of #9752, I'd point out that this problem has reinforced my dislike of having the "base" environment leak into virtual environments like this, so I'd actually oppose #9752 in its stated form. I'd like a much better justification of why the global setting isn't sufficient for the original use case, and assuming the change can be justified, I'd want the "base" config to be very explicitly not the same as the "site" config of the base environment. So I think there's more than just "re-adding" the feature involved here, more like "re-evaluating" and "re-designing" it in a way that accounts for the way the Windows Store distribution uses the existing config mechanism. |
Whoop, I missed that while skimming the issue! Sorry about that!
(at PyCon US, so my replies might be slow!) |
Ah! I tried that, but was confused that there was no reversion of the news entry. But I guess that makes sense, as it was merged into the changelog when I did the release. Thanks for confirming. |
Thanks for the heads up - I'll fix that! |
Description
Hey everyone,
I'm using pip typically in virtual environments (managed by PyCharm). Since version 23.1 I get an error message when installing packages.
A little research told me, that a --user flag within a venv does not really make sense. However, it seems that some kind of default --user is set since 23.1.
A workaround I found is to add the --no-user flag.
For completeness, downgrading to 23.0.1 with the --no-user flag gives the me the behavior I'm used to.
Not sure if this is a bug or a feature. Maybe I'm also missing something very obvious. But at least it is documented now for anyone experiencing the same issue :)
Expected behavior
No response
pip version
23.1
Python version
3.9
OS
Windows 10
How to Reproduce
create a venv with pip 23.1
try to install a package with
pip install <any-package-name>
Output
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
Code of Conduct
The text was updated successfully, but these errors were encountered: