How to work with transitive dependencies?

Technology CommunityCategory: PythonHow to work with transitive dependencies?
VietMX Staff asked 3 years ago

Transitive dependency is expressing the dependency of A on C when A depends on B and B depends on C.

If a transitive dependency is not explicitly specified in a project’s requirements.txt, pip will grab the version of the required library specified in the project’s install_requires section (of setup.py). If this section does not explicitly pin a version, you end up getting the latest version of that library.

If your application needs a specific version of a transitive dependency, pin it yourself in your application’s requirements.txt file. Then pip will do the right thing.