pip: Python Package Installer
by Tim Hopper
pip is the Python Package Authority’s (PyPA) standard package installer. It enables installing and managing Python packages from the Python Package Index (PyPI) and other package indexes. pip comes with modern Python installations and serves as the default tool for package operations in the Python ecosystem.
While pip remains Python’s default package installer, many workflows benefit from newer tools like uv that provide better performance and more integrated functionality.
Core Functionality
pip provides essential package management capabilities:
- Installing packages from PyPI and other indexes
- Uninstalling packages from environments
- Managing requirements files
- Installing packages in editable mode for development
- Generating PEP 751
pylock.tomllockfiles (experimental, added in pip 25.1) - Installing PEP 735 dependency groups (added in pip 25.1)
- Installing dependencies declared with PEP 723 inline script metadata (added in pip 26.0)
Key Commands
Installing Packages
# Install latest version
pip install requests
# Install specific version
pip install requests==2.31.0
# Install from requirements file
pip install -r requirements.txt
# Install a PEP 735 dependency group from pyproject.toml
pip install --group dev
# Install dependencies declared in a PEP 723 script
pip install --requirements-from-script script.py
# Install current directory in editable mode
pip install -e .Managing Requirements
# Output installed packages
pip freeze > requirements.txt
# Install from requirements
pip install -r requirements.txt
# Generate a PEP 751 lockfile (experimental)
pip lock -r requirements.txt -o pylock.tomlPackage Information
# List installed packages
pip list
# Show package details
pip show requests
# Check environment for conflicts
pip checkResolution Controls
# Only consider packages uploaded before a given date (pip 26.0+)
pip install --uploaded-prior-to 2025-01-01T00:00:00Z requests
# Exclude pre-releases for a specific package (pip 26.0+)
pip install --only-final fastapi
# Constrain build-time dependencies independently of runtime (pip 26.0+)
pip install --build-constraint build-constraints.txt -r requirements.txtLimitations
pip has limitations to consider:
- Lockfile support is experimental, and
pip lockdoes not yet cover environment markers or multi-platform resolution - Does not manage Python interpreters or virtual environments
- Slower package operations than uv, which resolves and installs in parallel
Learn More
Last updated on