skip to Main Content

I’ve been trying to install a package through pip on my rpi 3 model B
my operating system is raspbian. Debian based pip version is 21.0.1 and python version is 3.7.4
the command I’m using is:

python3 -m pip install librosa

the problem is that the dependency resolver takes way too long to resolve the conflicts.
and after a few hours, it keeps repeating this line over and over again for hours ( I even left the installation running for 2 days overnights )

INFO: pip is looking at multiple versions of <Python from requires-Python> to determine which version is compatible with other requirements. this could take a while.
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run you can press ctrl + c to do so.

I’ve tried using a stricter constraint such as adding "numpy > 1.20.0" and other stuff but now the popped up and I have no clue what I can do now.

3

Answers


  1. So as of pip 20.3, a new (not always working) resolver has been introduced. As of pip 21.0 the old (working) resolver is unsupported and slated for removal dependent on pip team resources.

    Changes to the pip dependency resolver in 20.3

    I have hit the same issue trying to build jupyter, my solution was to pin pip back to the 20.2 release which is the last release with the old resolver. This got past the point my builds were choking at using the new resolver under pip 21.1.1.

    A second approach that might work (untested) is to use the flag:

    –use-deprecated=legacy-resolver

    which appears to have been added when 20.3 switched over to the new resolver. This would allow the benefits of newer pip releases, until the backtracking issue is resolved, assuming it works.

    Login or Signup to reply.
  2. What is happening, according to the devs on this Github issue, is "pip downloads multiple versions [of each package] because the versions it downloaded conflict with other packages you specified, which is called backtracking and is a feature. The versions need to be downloaded to detect the conflicts." But it takes a very long time to download all of these versions. Pip explains this in detail, along with ways to resolve it or speed it up, at https://pip.pypa.io/en/latest/topics/dependency-resolution/.

    If you run

     pip install -r requirements.txt --use-deprecated=legacy-resolver
    

    you will not get this backtracking behavior, but your install will complete, and you will see an error at the end that is useful for troubleshooting:

    ERROR: pip’s legacy dependency resolver does not consider dependency conflicts when selecting packages. This behaviour is the source of the following dependency conflicts.

    apache-airflow-providers-amazon 2.6.0 requires boto3<1.19.0,>=1.15.0, but you’ll have boto3 1.9.253 which is incompatible.

    package_xyz 0.0.1 requires PyJWT==2.1.0, but you’ll have pyjwt 1.7.1 which is incompatible.

    Login or Signup to reply.
  3. Upgrading my pip to 21.3.1 worked

    python.exe -m pip install --upgrade pip
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search