pip
Python's standard package installer, which downloads packages from the Python Package Index and installs them.
In more detail
Inside an activated virtual environment, pip installs into that environment only. Running it as python -m pip guarantees it installs for the Python you mean, and pip install -r requirements.txt installs the packages listed in a requirements file.
Examples
pip install --quiet ansible-corepip install -r requirements.txtpython -m pip install -r requirements.lockpython -m pip install requestsRelated terms
- PyPI — The Python Package Index at pypi.org, the public online catalogue from which pip downloads third-party packages.
- virtual environment — A self-contained folder with its own Python and its own installed packages, so each project's packages stay separate.
- requirements.txt — A text file listing the Python packages, and usually their exact versions, that pip should install for a project.
- Python — A popular general-purpose programming language known for readable code and a large standard library.
- lock file — A file listing the exact version of every dependency, so installs are repeatable.
- wheel — The standard ready-to-install package file for Python, with a .whl extension, which pip can install without building anything.
- dependency cache — Saved copies of downloaded dependencies that GitHub Actions restores into later runs so they need not be fetched again.
- lockfile — A file that records the exact version of every dependency, including transitive ones, so every install gets the same set.
- requirements file — A text file, usually requirements.txt, listing the packages a project needs, one per line, often pinned to exact versions.
- package — A folder of Python modules that can be imported as a group, or a distributable bundle of Python code installed with pip.
- --require-hashes — A pip option that refuses to install anything not pinned to one version and matching a hash recorded in the requirements file.
Taught in
- Installing Ansible — Ansible Configuration Management at Scale
- Speeding Up Builds: Caching Dependencies — Continuous Integration & Continuous Delivery Pipelines
- Software Composition Analysis with Trivy — Cloud Security & DevSecOps Engineering
- Container Hardening: Distroless & Rootless — Cloud Security & DevSecOps Engineering
- Installing Python On Windows — Hands-on Python: Complete Video Course & Book
- Installing Python On A Mac — Hands-on Python: Complete Video Course & Book
- Installing Python On Linux — Hands-on Python: Complete Video Course & Book
- pip, requirements, and installing packages — Hands-on Python: Complete Video Course & Book
- Dependency Risk And Typosquatting — Application Security & Threat Modeling for Engineers
- Lockfiles And Reproducible Builds — Application Security & Threat Modeling for Engineers