pip
pip 24+Quick reference for the pip package installer CLI: install / uninstall / inspect packages, virtual environments, requirements files, configuration, and index management — with common options and practical examples.
37 commands
Help
pip --versionPrint the pip version and the Python interpreter it points to.
pip --versionpip --helpList every pip subcommand.
pip --helppip <subcommand> --helpShow all flags for one pip subcommand.
pip install --help | head -60Self
python -m pip --versionRun pip as a Python module — preferred over `pip` directly on systems with multiple Python interpreters.
python -m pip --versionpython -m pip install --upgrade pipUpgrade pip to the latest version. Combine with `python -m ensurepip` to bootstrap pip into a venv that lacks it.
python -m pip install --upgrade pippython -m ensurepip --upgradeBootstrap pip into a virtualenv that doesn't include it (PEP 453).
--upgrade; --default-pip
python -m ensurepip --upgradeInstall
pip install <pkg>Install the latest version of `<pkg>` from the default index (PyPI).
<pkg>; -r <req.txt>; -e <path>; -U; --upgrade-strategy only-if-needed|eager; --force-reinstall; --no-deps; --pre include pre-releases; --dry-run; --quiet
pip install requestspip install '<pkg>>=<ver>'Install with a version specifier (PEP 440). Use `>=`, `==`, `<`, `~=`, `!=`, `===`.
pip install 'django>=4.2,<5'pip install -r requirements.txtInstall every package listed in a requirements file (one specifier per line, `# comments` allowed).
-r <file>; -c <constraints>; --no-deps; --require-hashes
pip install -r requirements.txtpip install -e <path>Install a project in editable / development mode — your `src/` is symlinked into site-packages, edits are picked up live.
-e .; -e .[dev]; --no-deps
pip install -e .pip install '.[dev]'Install the current project with the optional extras declared in `pyproject.toml`.
pip install '.[dev,docs]'pip install git+https://github.com/<user>/<repo>.gitInstall directly from a Git repository (any ref: branch, tag, commit).
git+https://...; git+ssh://...; @branch; @tag; @commit
pip install 'git+https://github.com/requests/requests.git@main'pip install <pkg> --index-url <url>Install from an alternate index — corporate PyPI mirror, JFrog Artifactory, AWS CodeArtifact, etc.
pip install <pkg> --index-url https://pypi.org/simplepip install <pkg> --extra-index-url <url>Search an additional index alongside the default. Use `--no-index` to forbid remote fetches entirely.
pip install <pkg> --extra-index-url https://my-mirror/simplepip install --user <pkg>Install into the user's site-packages (`~/.local/`) instead of the system Python.
--user; --target <dir>
pip install --user pipxpip install --dry-run <pkg>Print what pip would install without actually installing — useful for CI previews.
--dry-run; --quiet; --report <file>
pip install --dry-run -r requirements.txtInspect
pip listList installed packages (Name / Version / Location columns).
--format columns|freeze|json; --outdated; --uptodate; --user; --local; --pre; --not-required; --exclude; --include-editable
pip list --format=freeze > freeze.txtpip list --outdatedList installed packages that have a newer version available.
--outdated; --format columns|freeze|json
pip list --outdated --format=columnspip show <pkg>Show metadata for a single installed package: version, location, requires, required-by, summary.
-f show every file; --files same; <pkg>...
pip show -f requestspip checkVerify installed packages have compatible dependencies — surfaces broken dep conflicts.
pip checkpip freezeOutput installed packages in `pkg==ver` format (sorted, no extras) — the canonical requirements.txt source.
--local; --user; --all; --exclude; --requirement <file>
pip freeze > requirements.lockUninstall
pip uninstall <pkg>Uninstall a package. Pass `-y` to skip the confirmation prompt.
<pkg>...; -y; -r <file> uninstall every package listed; --dry-run
pip uninstall -y requestspip uninstall -r requirements.txt -yUninstall every package listed in a requirements file.
pip uninstall -r requirements.txt -yIndex
pip download <pkg>Download wheels / sdist into a directory without installing. Useful for air-gapped transfers.
-d <dir>; --no-deps; --no-binary :all:; --dest <dir>; --platform
pip download requests -d ./wheelspip search <query>Search PyPI for a package by name / summary (currently disabled by PyPI; use the web UI instead).
pip search 'fastapi'pip wheel <pkg>Build wheels for a project and its dependencies into an output directory.
-w <dir>; --no-deps; --no-binary :all:; --no-build-isolation
pip wheel . -w ./wheelspip cache dirPrint the directory pip uses to cache downloaded files.
pip cache dirpip cache purgeClear pip's download cache. Useful when fixing a corrupted wheel file.
purge; list; info; remove <pattern>; --no-autoremove
pip cache purgepip config listPrint the active configuration (env vars + INI files at site / global / user scopes).
list; edit; get <name>; set <name> <value>; unset <name>; --global; --user; --site
pip config listpip config set global.index-url <url>Persist a setting into the active config file.
--global; --user; --site; --editor; <name> <value>
pip config set global.index-url https://my-mirror/simpleInspection
pip inspectDump every dependency, file, and metadata record of every installed package as JSON (used by Dependabot etc.).
pip inspect > installed.jsonHash
pip install --require-hashes -r requirements.txtInstall with hash-pinned requirements — pip refuses anything whose hash doesn't match (reproducible, tamper-proof).
pip install --require-hashes -r requirements.txtpip hash <file>Compute the SHA-256 (default) hash of a file for use in `--require-hashes` requirements.
<file>; --algorithm sha256|sha384|sha512
pip hash ./mypkg-1.0-py3-none-any.whlVCS
pip install git+ssh://[email protected]/<user>/<repo>@<ref>Install over SSH (useful for private packages behind 2FA).
@<branch>; @<tag>; @<commit>
pip install git+ssh://[email protected]/me/[email protected]Venv integration
python -m venv .venvCreate a virtual environment (Python's stdlib alternative to virtualenv). pip auto-installs into the venv once activated.
.venv; --system-site-packages; --prompt <name>; --without-pip; --upgrade-deps
python -m venv .venv && source .venv/bin/activateMisc
pip debug --verboseShow which pip version, supported tags (`cp311-cp311-manylinux_2_28_x86_64`), and Python versions pip can install for.
--verbose
pip debug --verbose | head -40pip install --upgrade pip setuptools wheelUpgrade the build toolchain inside the venv — needed when source distributions need a newer setuptools.
pip install --upgrade pip setuptools wheelRelated command cheatsheets
uv
Quick reference for the uv CLI: Python project init, dependency management, virtual environments, lockfile resolution, tool runners, and self-update — with common options and practical examples.
39 commands
uv 0.4+
conda
Quick reference for Conda CLI commands: environment management, package install / search, channels, lockfiles, configuration, and cleanup — with common options and practical examples.
40 commands
Conda 24+
pytest
Quick reference for the pytest CLI: test discovery, selection, fixtures, markers, parallelism, parametrize, and coverage integration — with common options and practical examples.
34 commands
pytest 8+
Trademark & Use Notice
These command-line tool cheatsheets are open community references. The names, logos, and trademarks of the tools referenced here (such as Git™, Docker™, Kubernetes®, kubectl, PostgreSQL®, MySQL®, Redis™, MongoDB®, Linux™, PowerShell™, Vim™, and others) are the property of their respective owners and are used here solely for identification and reference purposes.
All content in these cheatsheets is independently authored as a simplified, self-contained reference. It is not affiliated with, endorsed by, or sourced from any official documentation. Command listings, flag descriptions, and examples are original simplifications; for authoritative information please consult the official documentation of each tool.
Command syntax and option flags may differ across tool versions. The version tags shown reflect stable releases; behavior may differ in other versions. This cheatsheet does not imply any preference or recommendation by the trademark holders.
If a trademark or copyright owner believes that any content on this site infringes their rights, please send an email to [email protected]. Upon receiving valid proof of rights, we will modify or remove the relevant content within a reasonable period.
This website assumes no legal liability for any direct or indirect losses arising from the use of information presented on these pages.
About pip
pip is the standard Python package manager — the recursive acronym "pip installs packages". It was originally created by Ian Bicking in 2008 and adopted into the Python standard library as the default installer in Python 2.7.9 / 3.4. pip installs Python packages from PyPI (the Python Package Index) and any compatible PEP 503 repository. The current stable line is pip 24+ (with pip 25.x removing legacy resolver warnings). pip supports wheels (.whl), source distributions (.tar.gz), VCS URLs (`git+https://...`), and local editable installs (`pip install -e .`). For most workflows uv / Poetry / Hatch now supersede pip for project management, but pip remains the universal fallback — almost every Python tool's documentation assumes `pip install <pkg>`. pip is MIT-licensed, distributed under the Python Packaging Authority (PyPA). pip never uploads your code; it only fetches from configured indexes.
Cheatsheet version 1.0.0