[Solved]-(Re)Checking Dependencies with PIP

30👍

Nowadays python -m pip check should do the trick.

Seems to have been added as early as pip 9.0.0 released on 2016-11-02.

5👍

It’s not part of pip, but there is a tool you can use called pip-conflict-checker. Just install it through pip and run pipconflictchecker to get a dump of all the conflicts. pipdeptree could also help here.

You might also be interested in reading this article about dealing with pip dependency issues. The article also discusses the two tools I mentioned above along with strategies to fix broken dependencies.

👤kalebo

3👍

In recent pip versions using pip install -r requirements.txt will fail if you have any conflict in your dependencies specified in requirements.txt.

👤maciek

1👍

Personally I find that PIPDEPTREE available from PyPi works wonderfully.

Install it via pip install pipdeptree then run it directly from the command line. Currently it supports Python 3.8, 3.9, 3.10, 3.11, and 3.12

Depending on how big your current environment is, it may take awhile to parse through all of the installed packages, but the output (which defaults to the console) will be worth the wait.

The only issue I ever had was when I first ran it the console buffer was pretty small and I couldn’t scroll back to the beginning of the output. That was corrected by simply increasing the console buffer size then running the program again.

Side Note: It does not care how the Python packages were installed (ie. Conda and/or Pip). It will parse through them all and let you know where problems may be lurking.

This simple Python app has made troubleshooting dependency issues SIGNIFICANTLY easier for me.

Here’s the link to the project on PyPi:
https://pypi.org/project/pipdeptree/

Leave a comment