(Search) (../../search/) (Copyright) (../../copyright/) (pip search) (../pip_search/) (pip wheel) (../pip_wheel/) pip hash - pip documentation v24.3.dev0 (../../_static/pygments.css?v=a746c00c) (../../_static/styles/furo.css?v=354aac6f) (../../_static/copybutton.css?v=76b2166b) (../../_static/tabs.css?v=4c969af8) (/_/static/css/badge_only.css) (../../_static/styles/furo-extensions.css?v=302659d7) (/_/static/css/readthedocs-doc-embed.css) Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Hide navigation sidebar Hide table of contents sidebar Skip to content Toggle site navigation sidebar (../../) pip documentation v24.3.dev0 Toggle Light / Dark / Auto color theme Toggle table of contents sidebar (../../) pip documentation v24.3.dev0 (Search) (yes) (default) (../../getting-started/) Getting Started (../../installation/) Installation (../../user_guide/) User Guide (../../topics/) Topic Guides Toggle navigation of Topic Guides (../../topics/authentication/) Authentication (../../topics/caching/) Caching (../../topics/configuration/) Configuration (../../topics/dependency-resolution/) Dependency Resolution (../../topics/more-dependency-resolution/) More on Dependency Resolution (../../topics/https-certificates/) HTTPS Certificates (../../topics/local-project-installs/) Local project installs (../../topics/repeatable-installs/) Repeatable Installs (../../topics/secure-installs/) Secure installs (../../topics/vcs-support/) VCS Support (../../topics/python-option/) Managing a different Python interpreter (../../topics/workflow/) Pip is not a workflow management tool (../../reference/) Reference Toggle navigation of Reference (../../reference/build-system/) Build System Interface Toggle navigation of Build System Interface (../../reference/build-system/pyproject-toml/) pyproject.toml (../../reference/build-system/setup-py/) setup.py (legacy) (../../reference/requirement-specifiers/) Requirement Specifiers (../../reference/requirements-file-format/) Requirements File Format (../../reference/installation-report/) Installation Report (../../reference/inspect-report/) pip inspect JSON output specification (../) Commands Toggle navigation of Commands (../pip/) pip (../pip_install/) pip install (../pip_uninstall/) pip uninstall (../pip_inspect/) pip inspect (../pip_list/) pip list (../pip_show/) pip show (../pip_freeze/) pip freeze (../pip_check/) pip check (../pip_download/) pip download (../pip_wheel/) pip wheel pip hash (../pip_search/) pip search (../pip_cache/) pip cache (../pip_config/) pip config (../pip_debug/) pip debug Project (../../development/) Development Toggle navigation of Development (../../development/getting-started/) Getting Started (../../development/contributing/) Contributing (../../development/ci/) Continuous Integration (../../development/issue-triage/) Issue Triage (../../development/architecture/) Architecture of pip’s internals Toggle navigation of Architecture of pip’s internals (../../development/architecture/overview/) Broad functionality overview (../../development/architecture/anatomy/) Repository anatomy & directory structure (../../development/architecture/configuration-files/) Configuration File Handling (../../development/architecture/package-finding/) Finding and choosing files (index and PackageFinder ) (../../development/architecture/command-line-interface/) Command Line Interface (../../development/architecture/upgrade-options/) Options that control the installation process (../../development/release-process/) Release process (../../development/vendoring-policy/) Vendoring Policy (../../ux-research-design/) UX Research & Design Toggle navigation of UX Research & Design (../../ux-research-design/contribute/) How to Contribute (../../ux-research-design/guidance/) UX Guidance (../../ux-research-design/research-results/) UX Research Results Toggle navigation of UX Research Results (../../ux-research-design/research-results/about-our-users/) About pip’s Users (../../ux-research-design/research-results/mental-models/) How Users Understand pip (../../ux-research-design/research-results/users-and-security/) How pip users think about security (../../ux-research-design/research-results/ci-cd/) How pip is used in interactive environments (i.e. CI, CD) (../../ux-research-design/research-results/personas/) pip Personas (../../ux-research-design/research-results/prioritizing-features/) Prioritizing pip Features (../../ux-research-design/research-results/override-conflicting-dependencies/) Providing an override to install packages with conflicting dependencies (../../ux-research-design/research-results/pip-force-reinstall/) pip --force-reinstall (../../ux-research-design/research-results/pip-search/) pip search (../../ux-research-design/research-results/pip-upgrade-conflict/) pip Upgrade Conflict (../../ux-research-design/research-results/improving-pips-documentation/) Improving pip’s Documentation (../../news/) Changelog (https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md) Code of Conduct (https://github.com/pypa/pip) GitHub v: latest v: latest Versions (https://pip.pypa.io/en/latest/cli/pip_hash/) latest (https://pip.pypa.io/en/stable/cli/pip_hash/) stable On Read the Docs (//readthedocs.org/projects/pip/) Project Home (//readthedocs.org/projects/pip/builds/) Builds (//readthedocs.org/projects/pip/downloads/) Downloads On GitHub (https://github.com/pypa/pip/blob/main/docs/html/cli/pip_hash.rst) View (https://github.com/pypa/pip/edit/main/docs/html/cli/pip_hash.rst) Edit Search (Search docs) Hosted by (https://readthedocs.org) Read the Docs · (https://docs.readthedocs.io/page/privacy-policy.html) Privacy Policy Back to top (../../_sources/cli/pip_hash.rst.txt) (View this page) View this page (https://github.com/pypa/pip/edit/main/docs/html/cli/pip_hash.rst) (Edit this page) Edit this page Toggle Light / Dark / Auto color theme Toggle table of contents sidebar pip hash(Link to this heading) ¶ Usage(Link to this heading) ¶ Unix/macOS python - m pip hash [ options ] < file > ... Copy to clipboard Windows py - m pip hash [ options ] < file > ... Copy to clipboard Description(Link to this heading) ¶ Compute a hash of a local package archive. These can be used with --hash in a requirements file to do repeatable installs. Overview(Link to this heading) ¶ pip hash is a convenient way to get a hash digest for use with (../../topics/secure-installs/#hash-checking-mode) Hash-checking Mode , especially for packages with multiple archives. The error message from pip install --require-hashes ... will give you one hash, but, if there are multiple archives (like source and binary ones), you will need to manually download and compute a hash for the others. Otherwise, a spurious hash mismatch could occur when (../pip_install/#pip-install) pip install is passed a different set of options, like (../pip_install/#install-no-binary) --no-binary . Options(Link to this heading) ¶ -a , --algorithm (Link to this definition) ¶ The hash algorithm to use: one of sha256, sha384, sha512 (environment variable: PIP_ALGORITHM ) Example(Link to this heading) ¶ Compute the hash of a downloaded archive: Unix/macOS $ python -m pip download SomePackage Collecting SomePackage Downloading SomePackage-2.2.tar.gz Saved ./pip_downloads/SomePackage-2.2.tar.gz Successfully downloaded SomePackage $ python -m pip hash ./pip_downloads/SomePackage-2.2.tar.gz ./pip_downloads/SomePackage-2.2.tar.gz: --hash=sha256:93e62e05c7ad3da1a233def6731e8285156701e3419a5fe279017c429ec67ce0 Copy to clipboard Windows C:\> py -m pip download SomePackage Collecting SomePackage Downloading SomePackage-2.2.tar.gz Saved ./pip_downloads/SomePackage-2.2.tar.gz Successfully downloaded SomePackage C:\> py -m pip hash ./pip_downloads/SomePackage-2.2.tar.gz ./pip_downloads/SomePackage-2.2.tar.gz: --hash=sha256:93e62e05c7ad3da1a233def6731e8285156701e3419a5fe279017c429ec67ce0 Copy to clipboard (../pip_search/) Next pip search (../pip_wheel/) Previous pip wheel (../../copyright/) Copyright © The pip developers Made with (https://www.sphinx-doc.org/) Sphinx and (https://pradyunsg.me) @pradyunsg 's (https://github.com/pradyunsg/furo) Furo (https://readthedocs.org/projects/pip) (https://github.com/pypa/pip) On this page pip hash Usage Description Overview Options Example