-
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
[BUG] Installations like >=2.0.0 dont update the existing older version 1.0.0 of any package #12396
Comments
The reason is that the shell is seeing the unquoted This is why the output from the
If you add quotes around the dependency specifier, the newer version is installed as expected:
This is why there are quotes around the examples in the Those docs also link to this more general "requirements specifiers" page: ...which says:
That said, it's a totally understandable mistake to make - I just don't think there's any way from pip's side to try and make this easier to debug in the moment - since pip is already outputting the right thing to stdout (which would explain the issue), but the user just can't see it because the shell has redirected it to a file. The only real long term solution would be for shells to warn on redirect characters being used without whitespace either side of them perhaps - but that's unlikely to be something that is every viable for them to do given likely thousands of valid scripts in the wild that have omitted the whitespace. Or perhaps a shellcheck lint could be created to warn about potentially unintended redirects? |
Hi @edmorley , thx for quick response! How would that work in a |
Quotes must not be used in requirements files (and are not needed). From the docs I linked above:
This issue is specifically about how a shell works. When you list a dependency in a
This is not a pip issue. You're using characters that the shell treats as having special meaning. So you need to add quotes to tell the shell to ignore those characters and pass them verbatim to pip. Otherwise pip never gets the full command you typed. It might help for you to read: |
Thanks @edmorley for assisting here! ❤️ |
Description
When I do an installation sequence of e.g following where
pydantic
is just an exmaple, I got same issue with other packages likelangchain
, see langchain-ai/langchain#13069This returns:
It is keeping
2.0.0
for some reason, is this intended?Expected behavior
I would expect that the
pydantic==2.0.0
will be uninstalled and replaced with a more recent version.pip version
23.3.1
Python version
3.11.5 and 3.8.0
OS
Windows and Unix
How to Reproduce
Output
Code of Conduct
The text was updated successfully, but these errors were encountered: