pip-tools: pip-compile solving failure with tensorflow when solution exists
pip-compile fails to solve my requirements.in when a solution exists and pip install works.
(This seems quite similar to https://github.com/jazzband/pip-tools/issues/1420. I’m not sure if it’s the same underlying bug, so just filing a new issue.)
Environment Versions
- OS Type: docker image:
amd64/python:3.8-buster - Python version: 3.8.10
- pip version: 21.1.2
- pip-tools version: 6.2.0
Steps to replicate
$ docker run --rm -it --entrypoint bash amd64/python:3.8-buster
$ pip install -U pip wheel pip-tools
$ cat > requirements.in << EOF
tensorflow>=2.4.0
tensorflow-transform==0.29.0
EOF
$ pip-compile
Expected result
The following is a valid solution (not a full result, just listing the packages mentioned in the error message below):
tensorflow==2.4.2
tensorflow-serving-api==2.4.1
tensorflow-transform==0.29.0
tfx-bsl==0.29.0
Actual result
Could not find a version that matches tensorflow!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,<2.5,<3,>=1.15.2,>=2.4.0,>=2.5.0 (from -r requirements.in (line 1))
Tried: 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.4.0, 2.4.1, 2.4.2, 2.5.0
Skipped pre-versions: 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.2.0rc4, 2.3.0rc0, 2.3.0rc1, 2.3.0rc2, 2.4.0rc0, 2.4.0rc1, 2.4.0rc2, 2.4.0rc3, 2.4.0rc4, 2.5.0rc0, 2.5.0rc1, 2.5.0rc2, 2.5.0rc3
There are incompatible versions in the resolved dependencies:
tensorflow>=2.4.0 (from -r requirements.in (line 1))
tensorflow!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,<2.5,>=1.15.2 (from tensorflow-transform==0.29.0->-r requirements.in (line 2))
tensorflow!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,<3,>=1.15.2 (from tfx-bsl==0.29.0->tensorflow-transform==0.29.0->-r requirements.in (line 2))
tensorflow<3,>=2.5.0 (from tensorflow-serving-api==2.5.1->tfx-bsl==0.29.0->tensorflow-transform==0.29.0->-r requirements.in (line 2))
Other notes
- I’m not sure why the final line in the error says that
tensorflow-serving-api==2.5.1is required bytfx-bsl==0.29.0. From the tfx-bsl setup.py, you can see that tensorflow-server-api 2.4.* is allowed: https://github.com/tensorflow/tfx-bsl/blob/1c2d94198759642627b9d64f631adaf4af0968fd/setup.py#L176 - Adding
tensorflow-serving-api==2.4.*to the requirements.in as a “hint” allows pip-compile run successfully.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (4 by maintainers)
In case it’s helpful for others, I suggested an alternative approach to using pip-compile in this comment on a sister bug: https://github.com/jazzband/pip-tools/issues/1420#issuecomment-973146546