Skip to content

pipenv: Python Dependency Manager

pipenv is a dependency management tool for Python applications that wraps pip and virtualenv into a single CLI. It creates and manages a virtual environment per project, declares dependencies in a Pipfile, and produces a Pipfile.lock for reproducible installs.

pipenv should not be confused with pipx (installs CLI tools in isolated environments), pip-tools (compiles requirements files), or Pipfile (the dependency format pipenv reads).

When to Use pipenv

pipenv fits teams already committed to a Pipfile-based workflow where the existing lockfile and automatic virtualenv still cover their needs. It predates the pyproject.toml standards that the rest of the packaging ecosystem has adopted, and its dependency format is not read by other tools.

For new projects, uv covers the same application dependency management with faster resolution, Python version management, and a standards-based pyproject.toml workflow. Existing pipenv projects can follow How to migrate from Pipenv to uv.

Key Features

  • Automatic virtual environment creation and activation via pipenv shell
  • Dependency declaration in Pipfile with separate [packages] and [dev-packages] sections
  • Deterministic installs through Pipfile.lock, which pins every transitive dependency with content hashes
  • Security checking of installed packages via pipenv check
  • Dependency graph inspection with pipenv graph
  • .env file loading for environment variables
  • Custom script shortcuts defined in the [scripts] section of the Pipfile

Pros

  • Combines virtual environment management and dependency installation in one tool
  • Lockfile with hash verification provides reproducible, tamper-resistant installs
  • Separation of runtime and development dependencies is built into the Pipfile format

Cons

  • Uses the Pipfile format instead of the standard pyproject.toml project metadata, limiting interoperability with other tools
  • Slower dependency resolution than uv or Poetry
  • Cannot build or publish packages to PyPI; a separate build tool is still needed for distributable libraries
  • No built-in Python version management; relies on whatever interpreter is already installed

Learn More

Last updated on