Skip to content

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:

Language: 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.

Using Python's pip to Manage Your Projects' Dependencies

Tutorial

Using Python's pip to Manage Your Projects' Dependencies

What is pip? In this beginner-friendly tutorial, you'll learn how to use pip, the standard package manager for Python, so that you can install and manage packages that aren't part of the Python standard library.

basics tools

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

Have a question about this? Mentor AI can show you examples, compare related terms, and point you to tutorials.


By Leodanis Pozo Ramos • Updated Oct. 4, 2026