# PDM: Python Package and Dependency Manager


PDM is a Python package and dependency manager that implements the modern [PEP 517/518 build-system interface](https://pydevtools.com/handbook/explanation/what-is-pep-517.md) and reads [PEP 621 project metadata](https://pydevtools.com/handbook/explanation/what-is-pep-621-compatibility.md) from [pyproject.toml](https://pydevtools.com/handbook/reference/pyproject.toml.md).

## When to use PDM

Use PDM when you have an existing project built around its workflow and want a standards-compliant package manager with lockfile support and dependency groups. PDM's strict adherence to the [PEP 517/518](https://pydevtools.com/handbook/explanation/what-is-pep-517.md) build-system interface and [PEP 621](https://pydevtools.com/handbook/explanation/what-is-pep-621-compatibility.md) project metadata makes it a good fit for teams that prioritize alignment with official Python packaging standards. For new projects, [uv](https://pydevtools.com/handbook/reference/uv.md) provides [faster performance and broader functionality](https://pydevtools.com/handbook/explanation/which-python-package-manager-should-i-use.md); PDM's standalone build backend, pdm-backend, can still be used in uv projects without adopting the full PDM CLI.

{{< callout type="warning" >}}
While PDM is a capable tool, consider using [uv](../../reference/uv) instead for better performance, simpler workflows, and unified tooling across Python package/environment management.
{{< /callout >}}

## Key Features

- Dependency management with lockfile support
- Virtual environment management
- Build backend for packaging projects
- Plugin system for extensibility
- Centralized installation cache (similar to pnpm)
- Python installation via python-build-standalone

## pdm-backend

pdm-backend is PDM's [build backend](https://pydevtools.com/handbook/explanation/what-is-a-build-backend.md), distributed as a separate package. It can be used independently of the `pdm` CLI in any Python project, including [uv](https://pydevtools.com/handbook/reference/uv.md) projects:

```bash
uv init --build-backend pdm my-lib
```

This generates a `pyproject.toml` with pdm-backend as the build backend:

```toml
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
```

pdm-backend supports editable installs, dynamic versioning from SCM tags, and file inclusion/exclusion patterns. It reads standard PEP 621 metadata from `pyproject.toml`.

See the [pdm-backend documentation](https://backend.pdm-project.org/) for configuration options.

## PEP 751 pylock.toml support

PDM implements the [PEP 751 pylock.toml lockfile standard](https://pydevtools.com/handbook/explanation/what-is-pep-751.md). Two modes are available:

- `pdm export -f pylock -o pylock.toml` (added in 2.24.0) converts the existing `pdm.lock` into a `pylock.toml` for tools that consume the standard format.
- `pdm config lock.format pylock` (added in 2.25.0) switches PDM into direct-lock mode so `pdm lock` writes `pylock.toml` natively instead of `pdm.lock`.

PDM's maintainers have signalled that `pylock.toml` will eventually replace `pdm.lock` as the default lockfile format.

## Using uv as the installer

PDM has experimental support for using uv as its resolver and installer. Enable it with:

```bash
pdm config use_uv true
```

PDM will detect the `uv` binary on your system and use it for dependency resolution and installation. This is faster than PDM's default installer, without changing the rest of your PDM workflow. See [How to use uv to speed up PDM](https://pydevtools.com/handbook/how-to/how-to-use-uv-to-speed-up-pdm.md) for a full walkthrough, or the [PDM uv documentation](https://pdm-project.org/en/latest/usage/uv/) for limitations.

## Pros

- Modern standards compliance ([PEP 517/518](https://pydevtools.com/handbook/explanation/what-is-pep-517.md) build interface and [PEP 621](https://pydevtools.com/handbook/explanation/what-is-pep-621-compatibility.md) metadata)
- No need to create/activate virtual environments
- Supports dependency groups
- Fast dependency resolver
- Lockfile support

## Cons

- Smaller community and ecosystem than uv or Poetry
- Slower resolution and installation than uv unless [uv-mode](#using-uv-as-the-installer) is enabled

## Learn More

- [PDM Documentation](https://pdm-project.org/)
- [PDM GitHub Repository](https://github.com/pdm-project/pdm)
- [Example PDM Package](https://github.com/python-developer-tooling-handbook/demo-pdm)
- [Python packaging standards](https://packaging.python.org/)
