PIP-LOCK(1)

πŸ’… PIP-LOCK(1) β€” the pip lock glow-up

okay bestie, sit down, hydrate, and let me tell you about pip-lock β€” it's the lock command from the pip manual, section 1, and it is genuinely about to change your whole dependency situation. no cap. 🫢


✨ NAME ✨

pip-lock β€” the description of the pip lock command. that's it, that's the name, she's simple and she's iconic. πŸ’–


🌸 DESCRIPTION 🌸

EXPERIMENTAL β€” yes babe, she's experimental, we're in our beta era, be gentle. πŸ§ͺ

What she does: lock packages and their dependencies from:

  • PyPI (and other indexes) using requirement specifiers. πŸ›οΈ
  • VCS project urls. πŸ™
  • Local project directories. πŸ“
  • Local or remote source archives. πŸ—œοΈ

(that last one's local or remote source archives, fr fr.)

pip also supports locking from "requirements files", which are literally the easiest way to specify a whole environment to be installed. one file, whole vibe, periodt. ✨

⚠️ real talk, no cap: the generated lock file is only guaranteed to be valid for the current python version and platform. so if you ship it to a different python or a different platform, that's on you bestie, she never promised that. 😭

πŸŽ€ USAGE πŸŽ€

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, all four are valid, all four slay. πŸ’…


πŸ‘‘ OPTIONS πŸ‘‘

okay this is the part you actually came for. every single flag, no skips, I would never do you like that. 🫢

  • -o, --output <path> β€” the lock file name. default is pylock.toml. and if you pass - she writes to stdout instead, which is giving very "pipe me into something else" energy. πŸ“
    • (environment variable: PIP_OUTPUT)
  • -r, --requirement <file> β€” install from the given requirements file. you can use this option multiple times, stack 'em up. πŸ₯ž
    • (environment variable: PIP_REQUIREMENT)
  • --requirements-from-script <file> β€” install dependencies of the given script file, as defined by PEP 723 inline metadata. yes, your script can just contain its own deps now, main character energy fr. 🐍
    • (environment variable: PIP_REQUIREMENTS_FROM_SCRIPT)
  • -c, --constraint <file> β€” constrain versions using the given constraints file. also stackable, use it multiple times. πŸ”’
    • (environment variable: PIP_CONSTRAINT)
  • --build-constraint <file> β€” constrain build dependencies using the given constraints file. multiple times, again, go off. πŸ—οΈ
    • (environment variable: PIP_BUILD_CONSTRAINT)
  • --no-deps β€” don't install package dependencies. just the package, nothing else, she travels light. πŸ’€
    • (environment variable: 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. the classic, the legend. ✏️
    • (environment variable: PIP_EDITABLE)
  • --src <dir> β€” the directory to check out editable projects into. the default in a virtualenv is <venv path>/src, and the default for global installs is <current dir>/src. πŸ—‚οΈ
    • (environment variable: PIP_SRC, PIP_SOURCE, PIP_SOURCE_DIR, PIP_SOURCE_DIRECTORY)
  • --ignore-requires-python β€” ignore the Requires-Python information. she's not looking at it, she doesn't care, she's above it. πŸ™ˆ
    • (environment variable: PIP_IGNORE_REQUIRES_PYTHON)
  • --no-build-isolation β€” disable isolation when building a modern source distribution. ⚠️ heads up bestie: build dependencies specified by PEP 518 must already be installed if this option is used. no isolation, no safety net. 😭
    • (environment variable: PIP_NO_BUILD_ISOLATION)
  • --check-build-dependencies β€” check the build dependencies. that's the whole job. βœ…
    • (environment variable: PIP_CHECK_BUILD_DEPENDENCIES)
  • -C, --config-settings <settings> β€” configuration settings to be passed to the build backend. settings take the form KEY=VALUE. 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. security 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. the choices are [auto, on, off, raw] and the default is 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. leave the mess, she's not your mom. 🧹❌
    • (environment variable: PIP_NO_CLEAN)

πŸ’œ Author

pip developers β€” the whole crew, the collective, the group chat that actually ships. πŸ‘‘


The pip developers. 🫢


πŸ¦‹ SEE ALSO πŸ¦‹

(no SEE ALSO in the original, so nothing to link β€” but you know the vibes, go read the rest of the pip manual, iykyk πŸ“š)


okay that's the whole page bestie, you're fully locked in now. πŸ’– and for the cute sign-off: this whole thing is from version 26.0, dated Aug 26, 2026, and it's still PIP-LOCK(1) at the top and the bottom because she's consistent like that. go forth and lock your packages. slay. βœ¨πŸŽ€πŸ’…

πŸ“¦ where this page comes from
  • fedora 44: python3-pip 26.0.1-3.fc44 Β· MIT AND Python-2.0.1 AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MPL-2.0 AND (Apache-2.0 OR BSD-2-Clause)
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms