question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Confusing conflict message error message when pip can't build metadata for any version of package required

See original GitHub issue

Description

I was testing the following installation failure in https://github.com/pypa/pip/issues/10473 . It fails to install because one of the dependencies (weblogo) requires numpy to be installed to run it’s setup.py and it skips over each version of weblogo and then attempts backtracking down the wrong path.

ERROR: Cannot install dms-tools2 because these package versions have conflicting dependencies.

The conflict is caused by:
    phydms 2.4.1 depends on weblogo<3.6 and >=3.4
    phydms 2.4.0 depends on weblogo<3.6 and >=3.4
    phydms 2.3.8 depends on weblogo<3.6 and >=3.4
    phydms 2.3.7 depends on weblogo<3.6 and >=3.4
    phydms 2.3.6 depends on weblogo<3.6 and >=3.4
    phydms 2.3.5 depends on weblogo<3.6 and >=3.4
    phydms 2.3.4 depends on weblogo<3.6 and >=3.4
    phydms 2.3.3 depends on weblogo<3.6 and >=3.4
    phydms 2.3.2 depends on weblogo<3.6 and >=3.4
    phydms 2.3.1 depends on weblogo<3.6 and >=3.4
    phydms 2.3.0 depends on weblogo<3.6 and >=3.4
    phydms 2.2.2 depends on weblogo<3.6 and >=3.4
    phydms 2.2.1 depends on weblogo<3.6 and >=3.4
    phydms 2.2.0 depends on weblogo<3.6 and >=3.4
    phydms 2.1.4 depends on weblogo<3.6 and >=3.4
    phydms 2.1.3 depends on weblogo<3.6 and >=3.4
    phydms 2.1.2 depends on weblogo<3.6 and >=3.4

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

Expected behavior

It would be useful to let the user know that the reason this is conflicting is because there were no valid installs avaiable for these version numbers, e.g.:

The conflict is caused by:
    phydms 2.4.1 depends on weblogo<3.6 and >=3.4 (no valid package available)
    phydms 2.4.0 depends on weblogo<3.6 and >=3.4 (no valid package available)
    ...

Given what I know about the pip code base this is probably tricky to implement? But I do think it’s difficult for the user to parse the error message right now as pip is giving non-conflicting dependencies and saying they are conflicting.

pip version

21.3.1

Python version

all

OS

all

How to Reproduce

  1. On Linux
  2. sudo apt-get install build-essential
  3. python3 -m venv .venv
  4. source activate ./venv/bin/activate
  5. python -m pip install Cython (one of the other dependencies depends on Cython otherwise you get a similar error but with pysam instead of weblogo)
  6. python -m pip install dms-tools2

Output

No response

Code of Conduct

Edit: Note I edited this first post to reflect the current situation.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
notatallshawcommented, Mar 11, 2022

Yeah that’s why I closed it, but then I was a bit unsure and thought there might still be a way to reproduce it. I’ll have a think and open a new issue if there’s a specific way to reproduce it still.

1reaction
uranusjrcommented, Sep 21, 2021

Maybe failed to build package from source would be easier to understand for users? Not sure about the best wording here, the overall idea sounds good to me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flask package conflict - two different packages required two ...
It happens when you have conflict in the dependencies of your libs. Looks like you are already using the most recent version of...
Read more >
How to Publish an Open-Source Python Package to PyPI
In this step-by-step tutorial, you'll learn how to create a Python package for your project and how to publish it to PyPI, the...
Read more >
pip install - pip documentation v22.3.1
“eager” - dependencies are upgraded regardless of whether the currently installed version satisfies the requirements of the upgraded package(s). “only-if-needed ...
Read more >
pipenv Documentation - Read the Docs
The recommended way to install pipenv on most platforms is to install from pypi ... Automatically install required Python version when pyenv is...
Read more >
Why you should use Poetry instead of Pip or Conda for Python ...
We could of course use the command pip freeze > requirements.txt to persist the metadata of installed dependencies (i.e. package names and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found