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
pip-compile solving failure with tensorflow when solution exists #1436
Comments
You could verify if choosing to use an old resolver with |
I tried to use both the new and the old/deprecated resolver, and both worked and succeeded in installing the requirements file which pip-compile fails on. Here's what I did:
$ docker run --rm -it --entrypoint bash amd64/python:3.8-buster
# cat > requirements.in << EOF
tensorflow>=2.4.0
tensorflow-transform==0.29.0
EOF
# python -m venv /venv-pip-plain
# source /venv-pip-plain/bin/activate
# pip -V
pip 21.1.1 from /venv-pip-plain/lib/python3.8/site-packages/pip (python 3.8)
# pip install -r requirements.in
# pip freeze | grep -E '(tensorflow|tfx)'
tensorflow==2.4.2
tensorflow-estimator==2.4.0
tensorflow-metadata==0.29.0
tensorflow-serving-api==2.4.1
tensorflow-transform==0.29.0
tfx-bsl==0.29.0
# deactivate
# python -m venv /venv-pip-legacy
# source /venv-pip-legacy/bin/activate
# pip install --use-deprecated=legacy-resolver -r requirements.in
# pip freeze | grep -E '(tensorflow|tfx)'
tensorflow==2.5.0
tensorflow-estimator==2.5.0
tensorflow-metadata==0.29.0
tensorflow-serving-api==2.5.1
tensorflow-transform==0.29.0
tfx-bsl==0.29.0
# deactivate
# python -m venv /venv-pip-old
# source /venv-pip-old/bin/activate
# pip install pip==20.2.*
# pip -V
pip 20.2.4 from /venv-pip-old/lib/python3.8/site-packages/pip (python 3.8)
# pip install -r requirements.in
# pip freeze | grep -E '(tensorflow|tfx)'
tensorflow==2.5.0
tensorflow-estimator==2.5.0
tensorflow-metadata==0.29.0
tensorflow-serving-api==2.5.1
tensorflow-transform==0.29.0
tfx-bsl==0.29.0 |
In case it's useful, here's the full (edit: moved giant wall of text to a gist) |
And getting:
But |
In case it's helpful for others, I suggested an alternative approach to using pip-compile in this comment on a sister bug: #1420 (comment) |
using pip-compile (6.4.0) with requirements.in 1. ccxt, and 2. celery:
perhaps the 2nd version requirement is being skipped from celery? pip install -r requirements (21.3.1) in works just fine |
It should work with the upcoming backtracking resolver (see #1539). Click to expand results$ pip-compile --resolver backtracking
Using indexes:
https://pypi.org/simple
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile --resolver=backtracking
#
aiobotocore==2.1.1
# via s3fs
aiohttp==3.8.1
# via
# aiobotocore
# aiohttp-retry
# fsspec
# s3fs
aiohttp-retry==2.4.6
# via dvc
aioitertools==0.9.0
# via aiobotocore
aiosignal==1.2.0
# via aiohttp
appdirs==1.4.4
# via dvc
async-timeout==4.0.2
# via aiohttp
asyncssh==2.8.1
# via scmrepo
atpublic==3.0.1
# via flufl-lock
attrs==21.4.0
# via aiohttp
boto3==1.20.24
# via
# -r requirements.in
# aiobotocore
botocore==1.23.24
# via
# aiobotocore
# boto3
# s3transfer
certifi==2021.10.8
# via
# dulwich
# requests
cffi==1.15.0
# via
# cryptography
# pygit2
charset-normalizer==2.0.12
# via
# aiohttp
# requests
colorama==0.4.4
# via
# dvc
# rich
commonmark==0.9.1
# via rich
configobj==5.0.6
# via dvc
cryptography==36.0.1
# via asyncssh
dictdiffer==0.9.0
# via dvc
diskcache==5.4.0
# via dvc
distro==1.7.0
# via dvc
dpath==2.0.6
# via dvc
dulwich==0.20.32
# via scmrepo
dvc[s3]==2.9.4
# via -r requirements.in
flatten-dict==0.4.2
# via dvc
flufl-lock==7.0
# via dvc
frozenlist==1.3.0
# via
# aiohttp
# aiosignal
fsspec[http]==2022.1.0
# via
# dvc
# s3fs
# scmrepo
ftfy==6.1.1
# via python-benedict
funcy==1.17
# via
# dvc
# scmrepo
future==0.18.2
# via grandalf
gitdb==4.0.9
# via gitpython
gitpython==3.1.27
# via scmrepo
grandalf==0.6
# via dvc
idna==3.3
# via
# requests
# yarl
importlib-resources==5.4.0
# via dvc
jmespath==0.10.0
# via
# boto3
# botocore
mailchecker==4.1.12
# via python-benedict
multidict==6.0.2
# via
# aiohttp
# yarl
nanotime==0.5.2
# via dvc
networkx==2.6.3
# via dvc
packaging==21.3
# via dvc
pathspec==0.9.0
# via
# dvc
# scmrepo
phonenumbers==8.12.43
# via python-benedict
ply==3.11
# via dvc
psutil==5.9.0
# via
# dvc
# flufl-lock
pyasn1==0.4.8
# via dvc
pycparser==2.21
# via cffi
pydot==1.4.2
# via dvc
pygit2==1.8.0
# via scmrepo
pygments==2.11.2
# via rich
pygtrie==2.4.2
# via
# dvc
# scmrepo
pyparsing==3.0.7
# via
# dvc
# grandalf
# packaging
# pydot
python-benedict==0.25.0
# via dvc
python-dateutil==2.8.2
# via
# botocore
# python-benedict
python-fsutil==0.6.0
# via python-benedict
python-slugify==6.0.1
# via python-benedict
pyyaml==6.0
# via python-benedict
requests==2.27.1
# via
# dvc
# fsspec
# python-benedict
rich==11.2.0
# via dvc
ruamel-yaml==0.17.21
# via dvc
ruamel-yaml-clib==0.2.6
# via ruamel-yaml
s3fs[boto3]==2022.1.0
# via dvc
s3transfer==0.5.1
# via boto3
scmrepo==0.0.7
# via dvc
shortuuid==1.0.8
# via dvc
shtab==1.5.3
# via dvc
six==1.16.0
# via
# configobj
# flatten-dict
# python-dateutil
smmap==5.0.0
# via gitdb
tabulate==0.8.9
# via dvc
text-unidecode==1.3
# via python-slugify
toml==0.10.2
# via
# dvc
# python-benedict
tqdm==4.62.3
# via dvc
typing-extensions==4.1.1
# via
# aioitertools
# dvc
urllib3==1.26.8
# via
# botocore
# dulwich
# requests
voluptuous==0.12.2
# via dvc
wcwidth==0.2.5
# via ftfy
wrapt==1.13.3
# via aiobotocore
xmltodict==0.12.0
# via python-benedict
yarl==1.7.2
# via aiohttp
zc-lockfile==2.0
# via dvc
zipp==3.7.0
# via importlib-resources
# The following packages are considered to be unsafe in a requirements file:
# setuptools |
I think I have a similar example, the backtracking resolver does not solve it. Pip does. $ cat requirements.in
google-api-python-client==1.7.11
google-auth-oauthlib==0.4.2
google-auth-httplib2==0.0.3
firebase-admin==4.5.0
aiogoogle==1.1.13
google-auth==1.20.1 Latest release (6.5.1) does essentially what OP compained about: Pins second-order dependencies too high, too early: $ pip-compile
Could not find a version that matches google-auth<2.0dev,<3.0dev,==1.20.1,>=1.25.0,>=1.4.1 (from -r requirements.in (line 6))
Tried: 0.0.1, [...], 1.20.1, [...], 2.6.0
Skipped pre-versions: 2.0.0.dev0, 2.0.0.dev0, 2.0.0b1, 2.0.0b1
There are incompatible versions in the resolved dependencies:
google-auth==1.20.1 (from -r requirements.in (line 6))
google-auth<2.0dev,>=1.25.0 (from google-api-core[grpc]==1.31.5->firebase-admin==4.5.0->-r requirements.in (line 4))
google-auth<3.0dev,>=1.25.0 (from google-cloud-storage==2.1.0->firebase-admin==4.5.0->-r requirements.in (line 4))
google-auth (from google-auth-oauthlib==0.4.2->-r requirements.in (line 2))
google-auth>=1.4.1 (from google-api-python-client==1.7.11->-r requirements.in (line 1))
google-auth (from google-auth-httplib2==0.0.3->-r requirements.in (line 3))
google-auth (from aiogoogle==1.1.13->-r requirements.in (line 5)) The new resolver from #1539 still barfs $ pipx run --spec git+https://github.com/atugushev/pip-tools.git@new-resolver pip-compile --resolver=backtracking requirements.in
CRITICAL:pip._internal.resolution.resolvelib.factory:Cannot install google-auth==1.20.1 because these package versions have conflicting dependencies.
Traceback (most recent call last):
File "/home/slate/.local/pipx/shared/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 348, in resolve
self._add_to_criteria(self.state.criteria, r, parent=None)
File "/home/slate/.local/pipx/shared/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
raise RequirementsConflicted(criterion)
pip._vendor.resolvelib.resolvers.RequirementsConflicted: Requirements conflict: SpecifierRequirement('google-auth==1.20.1')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/slate/.local/pipx/shared/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 94, in resolve
result = self._result = resolver.resolve(
File "/home/slate/.local/pipx/shared/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 481, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/home/slate/.local/pipx/shared/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 350, in resolve
raise ResolutionImpossible(e.criterion.information)
pip._vendor.resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=SpecifierRequirement('google-auth==1.20.1'), parent=None)]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/slate/.local/pipx/.cache/d636a60d983d97c/bin/pip-compile", line 8, in <module>
sys.exit(cli())
File "/home/slate/.local/pipx/.cache/d636a60d983d97c/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/home/slate/.local/pipx/.cache/d636a60d983d97c/lib/python3.9/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/home/slate/.local/pipx/.cache/d636a60d983d97c/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/slate/.local/pipx/.cache/d636a60d983d97c/lib/python3.9/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/slate/.local/pipx/.cache/d636a60d983d97c/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/slate/.local/pipx/.cache/d636a60d983d97c/lib/python3.9/site-packages/piptools/scripts/compile.py", line 481, in cli
results = resolver.resolve(max_rounds=max_rounds)
File "/home/slate/.local/pipx/.cache/d636a60d983d97c/lib/python3.9/site-packages/piptools/resolver.py", line 585, in resolve
resolver.resolve(
File "/home/slate/.local/pipx/shared/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 103, in resolve
raise error from e
pip._internal.exceptions.DistributionNotFound: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts Both modern and legacy pip -- 22.0.3 and 20.3.4 -- made funny noises and downloaded many redundant versions when running $ pip check
No broken requirements found.
$ pip freeze | grep -E 'google-api-python-client|google-auth-oauthlib|google-auth-httplib2|firebase-admin|aiogoogle|google-auth'
aiogoogle==1.1.13
firebase-admin==4.5.0
google-api-python-client==1.7.11
google-auth==1.20.1
google-auth-httplib2==0.0.3
google-auth-oauthlib==0.4.2
$ pip freeze | grep -E 'google-api-core|google-cloud-storage' # The 2nd-order dependencies
google-api-core==1.22.1
google-cloud-storage==1.40.0 (longer regex generated with: |
I have a similar issue but with a different set of requirements. Here's my
dm-acme uses pinned dependencies for jax and tensorflow. The way I understand this is that if I do not pin or constrain the dependencies, then the resolver should figure out to use the pinned versions. However, I cannot get pip-compile to work in this case, giving the following error.
|
I have a similar issue with Python 3.9.2, pip 22.1.2 and pip-tools 6.6.2.
yields:
For some reason pip-compile does not detect that typing-extensions 3.10.0 would fulfill the two restrictions. |
Yes, you can add |
Thank you, but this did not help, as a
already yields
(This time tested in a virtualenv with Python 3.8.10, pip 22.1.2 and pip-tools 6.6.2.) Why does pip-compile not see 3.10.0~=3.7.4 as true? |
Because it isn't. See https://peps.python.org/pep-0440/#compatible-release |
Ah, sorry, my bad! I read the |
I found a different workaround now! I noticed that tensorflow_similarity 0.14.2 does not specify any bokeh version, so I found a suitable one. My working
This will probably also be found by the new backtracking resolver #1539? |
This has been fixed in #1539 with the backtracking resolver, try |
pip-compile fails to solve my requirements.in when a solution exists and
pip install
works.(This seems quite similar to #1420. I'm not sure if it's the same underlying bug, so just filing a new issue.)
Environment Versions
amd64/python:3.8-buster
Steps to replicate
Expected result
The following is a valid solution (not a full result, just listing the packages mentioned in the error message below):
Actual result
Other notes
tensorflow-serving-api==2.5.1
is 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#L176tensorflow-serving-api==2.4.*
to the requirements.in as a "hint" allows pip-compile run successfully.The text was updated successfully, but these errors were encountered: