Skip to content

Instantly share code, notes, and snippets.

@gaborgsomogyi
Last active September 15, 2023 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaborgsomogyi/88b302695bf3f1f0068130b0a7f791ba to your computer and use it in GitHub Desktop.
Save gaborgsomogyi/88b302695bf3f1f0068130b0a7f791ba to your computer and use it in GitHub Desktop.

Dependency management in python

Python is not able to handle 2 different versions from the same package.

Dependency handling issue

When Pip <20.3 finds an unresolvable dependency (resolves a dependecy to 2+ versions) then would not halt the installation process. It’d successfully continue the process by installing the first matching dependency in the list of conflicts.

...
ERROR: pip's dependency resolver does not consider dependency conflicts when
selecting packages. This behaviour is the source of the following dependency
conflicts.
flask 2.2.1 requires click>=8.0, but you'll have click 7.1.2 which is
incompatible.
...

More details can be found here.

This is basically a silent killer because some of the libraries are not going to work runtime but one must watch the log to catch error (instead of pip would stop).

Dependency handling solution

Upgrade to >=20.3 which contains a more strict dependency resolution algorithm + stops the installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment