Open gnilrets opened 8 months ago
Seems like a bug in the depresolver (resolvelib that pip relies on) or our exception handling. Try different pip versions, because we don't test each pip-tools release with every pip version. At least try using the pip version that was latest at the time of release.
This is because we use pip internals that are not public API. So I recommend locking pip-tools itself with its transitive deps just like you do for your app's deps.
Alternatively, if you use one of the latest pip versions, try upgrading pip-tools that can handle them.
I tried with pip-tools 7.4.1 and pip 24.0 (latest versions of both) and got the same error message.
I switched to the legacy resolver and got something much more interpretable
There are incompatible versions in the resolved dependencies:
cryptography==38.0.4 (from -c dagster.txt (line 47))
cryptography<43,>=41.0.5 (from pyOpenSSL==24.1.0->snowflake-connector-python[secure-local-storage]==3.7.1->-r dbt.in (line 6))
cryptography<43.0.0,>=3.1.0 (from snowflake-connector-python[secure-local-storage]==3.7.1->-r dbt.in (line 6))
cryptography>=3.4.0 (from pyjwt[crypto]==2.8.0->-c dagster.txt (line 162))
But I understand this is no longer the recommended resolver?
I think the latest pip has removed the legacy resolver already. I know that resolvelib is more correct and can't output conflicting deps like the old one could. If you use the old resolver, it might be worth running pip check
post install to verify the integrity. Plus, it's recommended anyway, when you issue multiple pip install
commands.
Does using just pip install -r dbt.in
without pip-tools work?
Here's a simplified version of the files that reproduces this issue (still using pip-tools 7.4.1 and pip 24.0):
# dagster.txt
pyOpenSSL==24.1.0
cryptography==38.0.4
# dbt.in
-c dagster.txt
snowflake-connector-python[secure-local-storage]~=3.4
No, pip install -r dbt.in
doesn't work, but it does give me a better error message.
ERROR: Cannot install -r dbt.in (line 3) because these package versions have conflicting dependencies.
The conflict is caused by:
snowflake-connector-python 3.7.0 depends on pyOpenSSL<24.0.0 and >=16.2.0
snowflake-connector-python 3.6.0 depends on pyOpenSSL<24.0.0 and >=16.2.0
snowflake-connector-python 3.5.0 depends on pyOpenSSL<24.0.0 and >=16.2.0
snowflake-connector-python 3.4.1 depends on pyOpenSSL<24.0.0 and >=16.2.0
snowflake-connector-python 3.4.0 depends on pyOpenSSL<24.0.0 and >=16.2.0
The user requested (constraint) pyopenssl==24.1.0
Compare this with pip-compile dbt.in
:
ERROR: Cannot install -r dbt.in (line 3) because these package versions have conflicting dependencies.
Traceback (most recent call last):
File "/Users/sterling.paramore/miniconda3/envs/eta-dagster/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve
result = self._result = resolver.resolve(
File "/Users/sterling.paramore/miniconda3/envs/eta-dagster/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/Users/sterling.paramore/miniconda3/envs/eta-dagster/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 439, in resolve
raise ResolutionImpossible(self.state.backtrack_causes)
pip._vendor.resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=SpecifierRequirement('pyOpenSSL<24.0.0,>=16.2.0'), parent=LinkCandidate('https://files.pythonhosted.org/packages/5d/72/67a35dbd9414e07ca99e767733fe0bb0eccc508fb300e104ae2d450e0f73/snowflake_connector_python-3.7.0-cp38-cp38-macosx_11_0_arm64.whl (from https://pypi.org/simple/snowflake-connector-python/) (requires-python:>=3.8)')), RequirementInformation(requirement=SpecifierRequirement('pyOpenSSL<24.0.0,>=16.2.0'), parent=LinkCandidate('https://files.pythonhosted.org/packages/b1/c2/5ecaadfc00dc55d8155a1bf44bcc6f060f7f9193f20296ee78776538ebbe/snowflake_connector_python-3.6.0-cp38-cp38-macosx_11_0_arm64.whl (from https://pypi.org/simple/snowflake-connector-python/) (requires-python:>=3.8)')), RequirementInformation(requirement=SpecifierRequirement('pyOpenSSL<24.0.0,>=16.2.0'), parent=LinkCandidate('https://files.pythonhosted.org/packages/0a/a2/296f0bf74f1027cd8664bd8defd69f7d676d42be65396ffed3a308ca2035/snowflake_connector_python-3.5.0-cp38-cp38-macosx_11_0_arm64.whl (from https://pypi.org/simple/snowflake-connector-python/) (requires-python:>=3.8)')), RequirementInformation(requirement=SpecifierRequirement('pyOpenSSL<24.0.0,>=16.2.0'), parent=LinkCandidate('https://files.pythonhosted.org/packages/1e/da/02591d9f263c00d557c421123cf65685cc7c210e136d6c3c6c65787c6015/snowflake_connector_python-3.4.1-cp38-cp38-macosx_11_0_arm64.whl (from https://pypi.org/simple/snowflake-connector-python/) (requires-python:>=3.8)')), RequirementInformation(requirement=SpecifierRequirement('pyOpenSSL<24.0.0,>=16.2.0'), parent=LinkCandidate('https://files.pythonhosted.org/packages/6f/de/4d45c29beb1a3f4d430af54ff8184108c3e5d0a73c419bddd2bf6b6929a9/snowflake_connector_python-3.4.0-cp38-cp38-macosx_11_0_arm64.whl (from https://pypi.org/simple/snowflake-connector-python/) (requires-python:>=3.8)'))]
It looks like the conflict information I need is somewhere in there, but it's not readable (at least not by a mere human like me).
Yeah, this is definitely worth improving. I guess, pip-tools needs to intercept the exception and print out the attached metadata in a more human-oriented format.
OTOH, if the error output is coming from a subprocess, we wouldn't be able to do anything about it. Somebody needs to inspect this deeper.
pip-tools
does catch pip
's DistributionNotFound
error, although one is not able to guess that from the exception. The error is, after resolution is found to be impossible, raised here:
We could definitely refrain from doing that and instead print out the conflict causes in human-readable format.
What's the problem this feature will solve?
Using pip-tools 7.3.0
I'm trying to generate a requirements.txt file from a requirements.in file that has constraints based on another file. There's a dependency conflict, but pip-compile no longer provides enough useful information to troubleshoot the issue. I feel like it was easier to interpret in earlier versions of pip-compile (maybe 1-2 years ago?), but now it's practically uninterpretable.
Here's my
dbt.in
file:When I try to pip-compile it, I get an error:
The only thing I can tell clearly is:
The dagster.txt file does not have any
dbt-core
packages, but presumablydagster
anddbt-core
both have some shared dependency that is in conflict. How can I use pip-compile to figure out what that is?Describe the solution you'd like
A human-readable version of the garbage following
pip._vendor.resolvelib.resolvers.ResolutionImpossible
in the error message above.