Skip to content
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) #12792

Closed
xkszltl opened this issue Jun 25, 2024 · 4 comments
Labels
type: support User Support

Comments

@xkszltl
Copy link

xkszltl commented Jun 25, 2024

Description

Pip 24.1 rejects the multi-constraint version.
I don't know if this is the issue with PEP440 enforcement, but the error msg is certainly misleading.

pip version

24.1

Python version

3.10

OS

Ubuntu 22.04

How to Reproduce

Have transformers[sentencepiece,torch]<4.26>=4.23.0 in requirements.txt and python3 -m pip install -Ur requirements.txt.

@xkszltl xkszltl added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Jun 25, 2024
@uranusjr
Copy link
Member

You are missing a comma. The correct format is

transformers[sentencepiece,torch]<4.26,>=4.23.0

@uranusjr uranusjr closed this as not planned Won't fix, can't repro, duplicate, stale Jun 25, 2024
@uranusjr uranusjr added type: support User Support and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Jun 25, 2024
@xkszltl
Copy link
Author

xkszltl commented Jun 25, 2024

Yes, I know, the problem here is that format was previously supported, and I cannot find any doc explicitly saying "this is deprecated and should be replaced by something else". All I found is PEP440 syntax doesn't include this.

@notatallshaw
Copy link
Member

notatallshaw commented Jun 25, 2024

but the error msg is certainly misleading.

I beleive the error message comes from packaging , while it isn't exactly identifying what you are missing, it is pointing to where the error is:

ERROR: Invalid requirement: 'transformers[sentencepiece,torch]<4.26>=4.23.0': Expected end or semicolon (after version specifier)
    transformers[sentencepiece,torch]<4.26>=4.23.0
                                     ~~~~~^ (from line 1 of requirements.txt)

I'm not an expert on how pip and packaging interact, but for improvements to the error message I beleive you will need to raise an issue over there.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: support User Support
Projects
None yet
Development

No branches or pull requests

3 participants