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 is pylock.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's requirements.txt format, or pylock.toml format. heads up: pylock.toml support 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 the Requires-Python information. 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 form KEY=VALUE, and you use multiple --config-settings options 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 --hash option. secure girlies stay winning πŸ”₯ (environment variable: PIP_REQUIRE_HASHES)
  • --progress-bar <progress_bar> β€” specify whether the progress bar should be used. in 'auto' mode, --quiet will 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 🫢


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