PIP3-LOCK(1)
π PIP3-LOCK(1) β pip's lock command, but make it make sense
okay bestie, welcome to the pip3-lock page, part of the pip manual suite (section 1, ftw). this is the one where we lock down your packages and their whole dependency tree so future-you doesn't get jump-scared by a surprise upgrade. pull up a chair, grab a strawberry π, and let's get into it.
β¨ NAME β¨
pip3-lock β literally just the description of the pip3 lock command. that's the whole name. short, sweet, iconic.
π DESCRIPTION π
EXPERIMENTAL β so bestie, be aware this is new-new, still cooking, handle with care π«Ά
this command locks packages and their dependencies when they come from:
- PyPI (and other indexes), using requirement specifiers.
- VCS project urls.
- local project directories.
- local or remote source archives.
pip ALSO supports locking from "requirements files", which is the easy-breezy way to point at a whole entire environment at once and be like "lock this, please". no cap.
β οΈ the generated lock file is only guaranteed to be valid for the current python version and platform. so don't go shipping it to your friend on a different setup and expecting it to behave. it's giving "same vibe, different machine, different chaos" π
πΈ USAGE πΈ
here's the vibe check on how you actually call it:
python -m pip lock [options] [-e] <local project path> ...
python -m pip lock [options] <requirement specifier> [package-index-options] ...
python -m pip lock [options] -r <requirements file> [package-index-options] ...
python -m pip lock [options] <archive url/path> ...
pick your lane, they all work π¦
π OPTIONS π
-o,--output<path> β the lock file name. default ispylock.toml. pass-and it goes straight to stdout, main character energy fr. (environment variable:PIP_OUTPUT)-r,--requirement<file> β install from the given requirements file. the file or URL can be in pip'srequirements.txtformat, orpylock.tomlformat. heads up:pylock.tomlsupport is experimental. you can use this option multiple times, stack 'em up π (environment variable:PIP_REQUIREMENT)--requirements-from-script<file> β install the dependencies of the given script file, as defined by PEP 723 inline metadata. cute little metadata living inside your script, obsessed. (environment variable:PIP_REQUIREMENTS_FROM_SCRIPT)-c,--constraint<file> β constrain versions using the given constraints file. can be used multiple times, no limit bestie. (environment variable:PIP_CONSTRAINT)--build-constraint<file> β constrain build dependencies using the given constraints file. also multiple-times-able. (environment variable:PIP_BUILD_CONSTRAINT)--no-depsβ don't install package dependencies. going solo, periodt. (environment variables:PIP_NO_DEPS,PIP_NO_DEPENDENCIES)-e,--editable<path/url> β install a project in editable mode (i.e. setuptools "develop mode") from a local project path or a VCS url. living your life on the edge, changes apply live β¨ (environment variable:PIP_EDITABLE)--src<dir> β where editable projects get checked out to. the default in a virtualenv is<venv path>/src, and the default for global installs is<current dir>/src. (environment variables:PIP_SRC,PIP_SOURCE,PIP_SOURCE_DIR,PIP_SOURCE_DIRECTORY)--ignore-requires-pythonβ ignore theRequires-Pythoninformation. pretending that requirement simply isn't there π (environment variable:PIP_IGNORE_REQUIRES_PYTHON)--no-build-isolationβ disable isolation when building a modern source distribution. build dependencies specified by PEP 518 must already be installed if this option is used β so do your homework first, bestie. (environment variable:PIP_NO_BUILD_ISOLATION)--check-build-dependenciesβ check the build dependencies. that's it, that's the whole thing β¨ (environment variable:PIP_CHECK_BUILD_DEPENDENCIES)-C,--config-settings<settings> β configuration settings passed to the build backend. settings take the formKEY=VALUE, and you use multiple--config-settingsoptions to pass multiple keys to the backend. (environment variable:PIP_CONFIG_SETTINGS)--require-hashesβ require a hash to check each requirement against, for repeatable installs. this option is implied when any package in a requirements file has a--hashoption. secure girlies stay winning π₯ (environment variable:PIP_REQUIRE_HASHES)--progress-bar<progress_bar> β specify whether the progress bar should be used. in'auto'mode,--quietwill suppress all progress bars. options are[auto, on, off, raw], default:auto. (environment variable:PIP_PROGRESS_BAR)--group<[path:]group> β install a named dependency-group from a"pyproject.toml"file. if a path is given, the name of the file must be"pyproject.toml". defaults to using"pyproject.toml"in the current directory. (environment variable:PIP_GROUP)--no-cleanβ don't clean up build directories. leaving the mess behind on purpose π (environment variable:PIP_NO_CLEAN)
π Author π
pip developers β the legends themselves π«Ά
π¦ Copyright π¦
The pip developers β yeah, they hold the rights, respect the icons.
π SEE ALSO π
no SEE ALSO references in this one bestie, we covered it all right here π
and that's a wrap! this lil page came from pip version 26.1, dated Jun 02, 2026, filed under PIP3-LOCK(1). go forth, lock those deps, and slay π
β¨π
π¦ where this page comes from
- ubuntu stonking: python3-pip 26.1.2+dfsg-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms