-
Notifications
You must be signed in to change notification settings - Fork 249
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
ERROR: Invalid requirement: 'transformers[sentencepiece,torch]<4.26>=4.23.0': Expected end or semicolon (after version specifier) #812
Comments
Sorry, I wasn't clear on the pip issue, yes all requirements have to conform to PEP440 enforcement and that's why you have an error, because it doesn't conform, otherwise you wouldn't have an error.
How exactly? As I posted over there, the error shows you exactly where the requirement is wrong. |
Btw, for comparison, this is what pip gives as the error message (as provided by packaging):
And this is what uv gives as the error (I think using pep440_rs):
I do like uv's "after parsing", but I prefer packaging's arrow pointing to exactly where it failed. |
|
Previously wrote something, but realized there was an issue with it, so deleted it. One data point that might be useful is the uv project, that apply "fixups" before parsing as pep440, I beleive they have done extensive checks, and often update based on user requirements. Perhaps someone could document these common patterns: https://github.com/astral-sh/uv/blob/ddacede7db4f0502c3e1430502baa77bdc71f088/crates/pypi-types/src/lenient_requirement.rs#L35-L72 It looks like they handle |
Although they only comment about >=x<y, their code does not seem to care about the order. It looks more like simple dividing by operator and re-compose. |
Marking this as a feature request. @xkszltl I edited one of your comments to come off as a bit nicer and less judgemental. |
Context
This was initially filed to pip side for 24.1 and PEP440, and they mentioned it may be a packaging issue:
According to this issue it may be related to PEP508 as well?
_parse_version_many
does not match PEP 508 or documentation #803Description
We found with pip 24.1 it rejects the multi-constraint version that was working a few days ago.
I don't know if this is the issue with PEP440 enforcement, but the error msg is certainly misleading.
Repro
Have
transformers[sentencepiece,torch]<4.26>=4.23.0
inrequirements.txt
andpython3 -m pip install -Ur requirements.txt
.The text was updated successfully, but these errors were encountered: