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
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.
For additional information on related topics, take a look at the following resources:
- Python's Requests Library (Guide) (Tutorial)
- Using Python's pip to Manage Your Projects' Dependencies (Tutorial)
- uv vs pip: Managing Python Packages and Dependencies (Tutorial)
- Managing Python Projects With uv: An All-in-One Solution (Tutorial)
- Working With Python Virtual Environments (Course)
- Python Virtual Environments: A Primer (Quiz)
- Making HTTP Requests With Python (Course)
- Python's Requests Library (Quiz)
- 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)
By Leodanis Pozo Ramos • Updated Jan. 9, 2026