A dependency is an external software component or prerequisite that an application needs to build or operate. In Python, dependencies commonly take the form of third-party packages or modules installed before they can be imported. section 10.6 section 19.5
Working with dependencies usually involves these practical decisions:
- Find a package suited to the task, then assess its source, quality, security, and functionality before trusting it. section 1.2.5 section 19.3
- Install third-party modules into a directory on Python’s module search path before importing them. section 10.6
- Choose an installer or package manager when it can resolve dependencies and handle complex build requirements. section 19.3
- Watch for version conflicts: prebuilt operating-system packages may be older and less flexible than other installation options. section 19.3
Installing a pinned dependency
Install the requests package with pip, upgrade it when needed, or constrain the installed version: python3 -m pip install requests; python3 -m pip install --upgrade requests; python3 -m pip install requests==2.32.3. In Colaboratory, prefix the command with !. section 19.5
$ python3 -m pip install requests
Use the command listing to see the basic pip form for adding a Python dependency. section 19.5


























