PDM, as described, is a modern Python package and dependency manager supporting the latest PEP standards. But it is more than a package manager. It boosts your development workflow in various aspects. The most significant benefit is it installs and manages packages
in a similar way to
npm that doesn't need to create a virtualenv at all!
- Opt-in PEP 582 support, no virtualenv involved at all.
- Simple and fast dependency resolver, mainly for large binary distributions.
- A PEP 517 build backend.
- PEP 621 project metadata.
- Flexible and powerful plug-in system.
- Versatile user scripts.
- Opt-in centralized installation cache like pnpm.
PDM requires Python 3.7+ to be installed. It works on multiple platforms including Windows, Linux and MacOS.
You can still have your project working on lower Python versions, read how to do it here.
Recommended installation method#
PDM requires python version 3.7 or higher.
Like Pip, PDM provides an installation script that will install PDM into an isolated environment.
For security reasons, you should verify the checksum of
The sha256 checksum is:
The installer will install PDM into the user site and the location depends on the system:
You can pass additional options to the script to control how PDM is installed:
1 2 3 4 5 6 7 8 9 10
You can either pass the options after the script or set the env var value.
Other installation methods#
Install the head version of GitHub repository. Make sure you have installed Git LFS on your system.
See also: https://pypa.github.io/pipx/
By copying the Pyprojectx wrapper scripts to a project, you can install PDM as (npm-style) dev dependency inside that project. This allows different projects/branches to use different PDM versions.
To initialize a new or existing project, cd into the project folder and:
Update the PDM version#
PDM supports generating completion scripts for Bash, Zsh, Fish or Powershell. Here are some common locations for each shell:
Then make sure pdm plugin is enabled in ~/.zshrc
1 2 3 4 5 6 7 8 9 10
Virtualenv and PEP 582#
In addition to the virtualenv management, PDM supports PEP 582 as an opt-in feature. You can learn more about the two modes in the corresponding chapters in Working with virtualenv and Working with PEP 582
Awesome PDM is a curated list of awesome PDM plugins and resources.