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:
$ 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.
Related Resources
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.
For additional information on related topics, take a look at the following resources:
- uv vs pip: Managing Python Packages and Dependencies (Tutorial)
- Managing Python Projects With uv: An All-in-One Solution (Tutorial)
- Hosting a Django Project on Heroku (Tutorial)
- Python's Requests Library (Guide) (Tutorial)
- Dependency Management With Python Poetry (Tutorial)
- Python Virtual Environments: A Primer (Tutorial)
- Managing Dependencies With Python Poetry (Course)
- A Beginner's Guide to pip (Course)
- Using Python's pip to Manage Your Projects' Dependencies (Quiz)
- uv vs pip: Python Packaging and Dependency Management (Course)
- uv vs pip: Managing Python Packages and Dependencies (Quiz)
- Python Project Management With uv (Course)
- Managing Python Projects With uv: An All-in-One Solution (Quiz)
- Host Your Django Project on Heroku (Course)
- Making HTTP Requests With Python (Course)
- Python's Requests Library (Quiz)
- Dependency Management With Python Poetry (Quiz)
- Working With Python Virtual Environments (Course)
- Python Virtual Environments: A Primer (Quiz)
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