13

Pip installation is stuck in an infinite loop if there are unresolvable conflicts in dependencies. To reproduce, pip==20.3.0 and:

pip install pyarrow==2.0.0 azureml-defaults==1.18.0
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Cody Peterson
  • 133
  • 1
  • 5
  • How do you know it's an infinite loop? Do you get any output? Please [edit] the question to be as specific as possible. – IMSoP Dec 02 '20 at 16:55
  • 1
    @IMSoP infinite loop means exactly infinite loop you can get with the repro above or any other set of packages with conflicting dependencies ranges. – vizhur Dec 02 '20 at 17:03
  • @vizhur But an infinite loop of _what_? Presumably you're seeing some repeated output that makes you see that it's a "loop" rather than a "sleep"? – IMSoP Dec 02 '20 at 17:08
  • infinite loop trying to resolve the dependencies. got requirements for A, verified them for B, didn't work verify B requirements with A. so when you run the command above you can clearly see that. You can add verbosity to see mode details `pip install pyarrow==2.0.0 azureml-defaults==1.18.0 -v -v -v` more info here https://github.com/pypa/pip/issues/9187 – vizhur Dec 02 '20 at 17:14
  • 2
    @vizhur My request was simply for the OP to include some output in the question, because that helps everyone on this site. Steps to reproduce are useful, but seeing the output without needing a matching environment means a lot more people can help answer the question. It also helps future readers know whether what they're seeing is the same problem, even if they're not running exactly the same command. – IMSoP Dec 02 '20 at 17:24
  • 1
    The problem also exists with `pip==20.3.1`. – Eric Platon Dec 03 '20 at 23:35

1 Answers1

12

Workarounds:

Local environment: Downgrade pip to < 20.3

Conda environment created from yaml: This will be seen only if conda-forge is highest priority channel, anaconda channel doesn't have pip 20.3 (as of now). To mitigate the issue please explicitly specify pip<20.3 (!=20.3 or =20.2.4 pin to other version) as a conda dependency in the conda specification file

AzureML experimentation: Follow the case above to make sure pinned pip resulted as a conda dependency in the environment object, either from yml file or programmatically

vizhur
  • 467
  • 3
  • 7
  • Going back to older pip will work but only for this ugly reason: old pip's resolver silently breaks stuff, new one fails to install instead. If there are unresolvable conflicts it would rather make sense to play with constraints and find some configurations that would work. [source](https://github.com/pypa/pip/issues/9187) – Kamil Apr 20 '21 at 15:32
  • 1
    That's why it says workarounds and mitigation but not a solution. Right solution would be to resolve the conflicts (though sometimes it might be close to impossible) – vizhur May 27 '21 at 13:57