-
-
Notifications
You must be signed in to change notification settings - Fork 617
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
Unhelpful error message when python version requirement is not met #1282
Comments
Can you reproduce without involving pipenv? |
I couldn't reproduce the error and when I try to use venv+pyenv+piptools to install dataclasses in a python 3.5 environment, the install is successful but the import fails with another unhelpful error message (see below). $pyenv local 3.5.5 dataclasses $pip-compile requirements.in Collecting dataclasses $python Traceback (most recent call last): |
The dataclasses project requires Python 3.6, so it is not compatible with your environment. It is up to them to properly declare that metadata and is not the fault of pip-tools. |
My bad - dataclasses does declare that it requires python3.6 in setup.py, but only in versions 0.7 and above. Hence version 0.6 gets installed by default when I try to install dataclasses in a python3.5 environment. However if I specify dataclasses==0.8 in the requirements.ini, pip-compile fails with the following error message (I've removed the traceback for clarity): ERROR: Could not find a version that satisfies the requirement dataclasses==0.8 (from -r requirements.in (line 1)) (from versions: 0.1, 0.2, 0.3, 0.4, 0.5, 0.6) Which matches the error message I received with pipenv. Was I reading the error message incorrectly and "matching distribution" means "matching python version"? Is the error message coming from pip instead of pip-tools? Happy to close if you think there's nothing pip-tools can do :-) |
Correct, that's pip's message. It might be a good idea to raise an issue on pip's tracker to improve UX in this particular case. $ python -V
Python 3.5.10
$ pip install dataclasses==0.8
ERROR: Could not find a version that satisfies the requirement dataclasses==0.8
ERROR: No matching distribution found for dataclasses==0.8 |
Did some digging and it has already been raised an issue with pip so closing this ticket - thanks for the quick response :-) |
What's the problem this feature will solve?
When I try to install a package that requires a different python version to the default / installed python version, pipenv prints an error message that is unhelpful. I raised on ticket on pipenv (pypa/pipenv#4573) but I was told this was an issue in pip-tools.
For example when attempting to install dataclasses (which requires python 3.6) in python 3.8 environment :
$ pipenv install dataclasses --python 3.8
Creating a Pipfile for this project…
Installing dataclasses…
Looking in indexes: https://pypi.python.org/simple
Collecting dataclasses
Using cached dataclasses-0.6-py3-none-any.whl (14 kB)
Installing collected packages: dataclasses
Successfully installed dataclasses-0.6
Adding dataclasses to Pipfile's [packages]…
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (3b8787)!
Installing dependencies from Pipfile.lock (3b8787)…
An error occurred while installing dataclasses==0.8! Will try again.
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 1/1 — 00:00:01
Installing initially–failed dependencies…
Looking in indexes: https://pypi.python.org/simple00
ERROR: Could not find a version that satisfies the requirement dataclasses==0.8 (from -r /tmp/pipenv-iaa6wplp-requirements/pipenv-0xs63m0r-requirement.txt (line 1)) (from versions: 0.1, 0.2, 0.3, 0.4, 0.5, 0.6)
ERROR: No matching distribution found for dataclasses==0.8 (from -r /tmp/pipenv-iaa6wplp-requirements/pipenv-0xs63m0r-requirement.txt (line 1))
Describe the solution you'd like
Print useful error message when python requirement not met, ideally which python version is compatible
Alternative Solutions
Not sure
Additional context
OS: Ubuntu WSL1
Pipenv version: '2020.11.15'
The text was updated successfully, but these errors were encountered: