transitive dependency

A transitive dependency is an indirect requirement of your project. It’s a package that your code doesn’t use directly, but that one of your direct dependencies needs in order to work. For example, if your project depends on package A, and A depends on package B, then B is a transitive dependency of your project.

Transitive dependencies matter because they affect what gets installed, which versions are selected during resolution, and how reproducible your environment is.

Example

In the example below, you create a fresh virtual environment and install the requests library as a direct dependency:

Shell
$ python -m venv venv/
$ source venv/bin/activate
(venv) $ python -m pip install requests

(venv) $ python -m pip list
Package            Version
------------------ --------
certifi            ...
charset-normalizer ...
idna               ...
pip                ...
requests           ...
urllib3            ...

As a result of installing requests, several other packages are installed. Those are transitive dependencies.

Tutorial

Python Virtual Environments: A Primer

Create isolated project setups on all platforms, and gain a deep understanding of Python's virtual environments created with the venv module.

intermediate devops tools

For additional information on related topics, take a look at the following resources:


By Leodanis Pozo Ramos • Updated Jan. 9, 2026