<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/tool-agnostic-python-lock-files-with-pep-751-and-pylock-toml-real-python-z0weyr53v" -->

---
title: Tool-Agnostic Python Lock Files With PEP 751 and...
description: PEP 751 introduces pylock.toml, a standardized, tool-agnostic Python lock file format that records fully resolved dependencies with exact versions, artifact...
canonical: https://daily.dev/posts/tool-agnostic-python-lock-files-with-pep-751-and-pylock-toml-real-python-z0weyr53v
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Tool-Agnostic Python Lock Files With PEP 751 and pylock.toml – Real Python | daily.dev
og:description: PEP 751 introduces pylock.toml, a standardized, tool-agnostic Python lock file format that records fully resolved dependencies with exact versions, artifact...
og:url: https://daily.dev/posts/tool-agnostic-python-lock-files-with-pep-751-and-pylock-toml-real-python-z0weyr53v
og:image: https://api.daily.dev/og/posts/Z0WEYr53V.png
og:image:alt: Tool-Agnostic Python Lock Files With PEP 751 and pylock.toml – Real Python
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Tool-Agnostic Python Lock Files With PEP 751 and pylock.toml – Real Python

**[Real Python](https://daily.dev/sources/rpython)** · 17 min read · 2 upvotes · 0 comments

## Summary

PEP 751 introduces pylock.toml, a standardized, tool-agnostic Python lock file format that records fully resolved dependencies with exact versions, artifact URLs, and cryptographic hashes. Unlike requirements.txt (which is pip-specific), pylock.toml can be generated by pip (v25.1+) or uv and consumed by pip, uv, and pdm interchangeably. The tutorial walks through generating a lock file from requirements.txt using pip lock, inspecting its structure (package metadata, wheel entries, SHA256 hashes), comparing it to pip-compile output, and using the same lock file across pip, uv, and pdm. Key advantages include cross-tool portability, hash-verified installs, and support for multiple dependency groups. Current limitations include uneven tool adoption and partial support for advanced features like multi-environment groupings.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://realpython.com/python-lock-file-pylock-toml>

## Questions this post answers

### What is pylock.toml and how does PEP 751 change Python dependency locking?

pylock.toml is a standardized, tool-agnostic lock file format defined in PEP 751 that records the exact, fully resolved set of dependencies a project needs, including versions and verified artifact hashes. Unlike requirements.txt, which is a pip-specific implementation detail, pylock.toml can be generated and consumed by pip, uv, and pdm, and can hold multiple dependency groups instead of just one set of packages.

_Track how pylock.toml adoption evolves across Python packaging tools on daily.dev before migrating your project._

### How do I generate a pylock.toml file using pip?

Use pip version 25.1 or newer with the experimental pip lock command, run as 'python -m pip lock --requirement requirements.txt', which resolves the full dependency graph from a requirements.txt file and writes a pylock.toml capturing exact versions, wheel filenames, download URLs, and cryptographic hashes for every explicit and transitive dependency.

_Developers migrating off requirements.txt can compare pip, uv, and pdm workflows for reproducible installs via daily.dev._

### Can I install a pylock.toml file with pip, uv, and pdm interchangeably?

Yes, pip version 26.1 or newer supports installing from pylock.toml via 'pip install -r pylock.toml', uv supports it experimentally through 'uv pip sync pylock.toml --preview-features pylock', and pdm can sync from it with 'pdm sync --lockfile pylock.uv.toml'. Support is still experimental and uneven, and uv's import doesn't yet update pyproject.toml or integrate with its project management model.

_Teams choosing between pip, uv, and pdm for cross-tool lock files can weigh trade-offs discussed on daily.dev._

## Similar posts on daily.dev

- [Why it took 4 years to get a lock files specification](https://daily.dev/posts/why-it-took-4-years-to-get-a-lock-files-specification-dw44boy2l) · Planet Python · 0 upvotes · 1 comments
- [What’s up Python? Pip supports locking, .pth files deprecated](https://daily.dev/posts/what-s-up-python-pip-supports-locking-pth-files-deprecated-n4hooa91j) · Bite Code · 3 upvotes · 2 comments
- [Pip 26.1 Ships Dependency Cooldowns and Experimental Lockfile Support to Combat Supply Chain Attacks](https://daily.dev/posts/pip-26-1-ships-dependency-cooldowns-and-experimental-lockfile-support-to-combat-supply-chain-attacks-j2wgrl3af) · InfoQ · 1 upvotes · 0 comments
- [pip 26.1 released](https://daily.dev/posts/pip-26-1-released-fdhfadwuu) · LWN.net · 0 upvotes · 0 comments
- [How to Manage Your Python Projects with Poetry](https://daily.dev/posts/how-to-manage-your-python-projects-with-poetry-4esotkyvy) · freeCodeCamp · 2 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#pip](https://daily.dev/tags/pip)

[View this post on daily.dev](https://daily.dev/posts/tool-agnostic-python-lock-files-with-pep-751-and-pylock-toml-real-python-z0weyr53v)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Tool-Agnostic Python Lock Files With PEP 751 and pylock.toml – Real Python","url":"https://daily.dev/posts/tool-agnostic-python-lock-files-with-pep-751-and-pylock-toml-real-python-z0weyr53v","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/tool-agnostic-python-lock-files-with-pep-751-and-pylock-toml-real-python-z0weyr53v"},"datePublished":"2026-07-22T14:10:37.719Z","dateModified":"2026-09-13T19:53:44.238Z","description":"PEP 751 introduces pylock.toml, a standardized, tool-agnostic Python lock file format that records fully resolved dependencies with exact versions, artifact...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/50cfb0e71bcc864b09a13f09525b390a?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/50cfb0e71bcc864b09a13f09525b390a?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Real Python","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Real Python","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/rpython","url":"https://daily.dev/sources/rpython"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/tool-agnostic-python-lock-files-with-pep-751-and-pylock-toml-real-python-z0weyr53v","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,pip","timeRequired":"PT17M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Real Python","item":"https://daily.dev/sources/rpython"},{"@type":"ListItem","position":3,"name":"Tool-Agnostic Python Lock Files With PEP 751 and pylock.toml – Real Python"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/tool-agnostic-python-lock-files-with-pep-751-and-pylock-toml-real-python-z0weyr53v#faq","mainEntity":[{"@type":"Question","name":"What is pylock.toml and how does PEP 751 change Python dependency locking?","acceptedAnswer":{"@type":"Answer","text":"pylock.toml is a standardized, tool-agnostic lock file format defined in PEP 751 that records the exact, fully resolved set of dependencies a project needs, including versions and verified artifact hashes. Unlike requirements.txt, which is a pip-specific implementation detail, pylock.toml can be generated and consumed by pip, uv, and pdm, and can hold multiple dependency groups instead of just one set of packages. Track how pylock.toml adoption evolves across Python packaging tools on daily.dev before migrating your project."}},{"@type":"Question","name":"How do I generate a pylock.toml file using pip?","acceptedAnswer":{"@type":"Answer","text":"Use pip version 25.1 or newer with the experimental pip lock command, run as 'python -m pip lock --requirement requirements.txt', which resolves the full dependency graph from a requirements.txt file and writes a pylock.toml capturing exact versions, wheel filenames, download URLs, and cryptographic hashes for every explicit and transitive dependency. Developers migrating off requirements.txt can compare pip, uv, and pdm workflows for reproducible installs via daily.dev."}},{"@type":"Question","name":"Can I install a pylock.toml file with pip, uv, and pdm interchangeably?","acceptedAnswer":{"@type":"Answer","text":"Yes, pip version 26.1 or newer supports installing from pylock.toml via 'pip install -r pylock.toml', uv supports it experimentally through 'uv pip sync pylock.toml --preview-features pylock', and pdm can sync from it with 'pdm sync --lockfile pylock.uv.toml'. Support is still experimental and uneven, and uv's import doesn't yet update pyproject.toml or integrate with its project management model. Teams choosing between pip, uv, and pdm for cross-tool lock files can weigh trade-offs discussed on daily.dev."}}]}
```

