Python

pip

pip package manager commands for Python dependency management.

25 commands
Windows MacOS Linux
#package-manager #python

Install & Uninstall

Install a package
pip install <package>
Install a specific version
pip install <package>==1.2.3
Upgrade a package to latest
pip install --upgrade <package>
Install for current user only
pip install --user <package>
Uninstall a package
pip uninstall <package>
Install multiple packages
pip install <package1> <package2>

Requirements

Export installed packages to file
pip freeze > requirements.txt
Install from requirements file
pip install -r requirements.txt
List all installed packages with versions
pip freeze
Install with version constraints
pip install --constraint constraints.txt <pkg>
Install current directory in editable mode
pip install -e .

Package Info

Show package metadata and location
pip show <package>
List all installed packages
pip list
List packages with updates available
pip list --outdated
Search PyPI for packages
pip search <query>
Verify installed packages have compatible deps
pip check
Download a package without installing
pip download <package>

Configuration

Show active configuration
pip config list
Set a custom package index
pip config set global.index-url <url>
Install from a custom index
pip install --index-url <url> <pkg>
Remove all items from the pip cache
pip cache purge
Install without using cache
pip install --no-cache-dir <package>

Quick Commands

Install a Python package from PyPI
pip install <package>
Export installed packages to a requirements file
pip freeze > requirements.txt
List packages that have newer versions available
pip list --outdated