# pipenv: Python Dependency Manager


pipenv is a dependency management tool for Python [applications](https://pydevtools.com/handbook/explanation/what-is-a-python-application.md) that wraps [pip](https://pydevtools.com/handbook/reference/pip.md) and [virtualenv](https://pydevtools.com/handbook/reference/virtualenv.md) into a single CLI. It creates and manages a [virtual environment](https://pydevtools.com/handbook/explanation/what-is-a-virtual-environment.md) per project, declares dependencies in a [Pipfile](https://pydevtools.com/handbook/reference/pipfile.md), and produces a `Pipfile.lock` for reproducible installs.

pipenv should not be confused with [pipx](https://pydevtools.com/handbook/reference/pipx.md) (installs CLI tools in isolated environments), [pip-tools](https://pydevtools.com/handbook/reference/pip-tools.md) (compiles requirements files), or [Pipfile](https://pydevtools.com/handbook/reference/pipfile.md) (the dependency format pipenv reads).

## When to Use pipenv

pipenv fits teams already committed to a Pipfile-based workflow where the existing [lockfile](https://pydevtools.com/handbook/explanation/what-is-a-lock-file.md) and automatic virtualenv still cover their needs. It predates the [pyproject.toml](https://pydevtools.com/handbook/reference/pyproject.toml.md) standards that the rest of the packaging ecosystem has adopted, and its dependency format is not read by other tools.

For new projects, [uv](https://pydevtools.com/handbook/reference/uv.md) 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](https://pydevtools.com/handbook/how-to/how-to-migrate-from-pipenv-to-uv.md).

## Key Features

- Automatic virtual environment creation and activation via `pipenv shell`
- Dependency declaration in [Pipfile](https://pydevtools.com/handbook/reference/pipfile.md) 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](https://pydevtools.com/handbook/reference/pipfile.md) format instead of the standard [pyproject.toml](https://pydevtools.com/handbook/reference/pyproject.toml.md) [project metadata](https://pydevtools.com/handbook/explanation/what-is-pep-621-compatibility.md), limiting interoperability with other tools
- Slower dependency resolution than [uv](https://pydevtools.com/handbook/reference/uv.md) or [Poetry](https://pydevtools.com/handbook/reference/poetry.md)
- Cannot build or publish packages to [PyPI](https://pydevtools.com/handbook/explanation/what-is-pypi.md); 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

- [pipenv documentation](https://pipenv.pypa.io)
- [Managing Application Dependencies tutorial](https://packaging.python.org/en/latest/tutorials/managing-dependencies/) (Python Packaging User Guide)
- [pipenv on GitHub](https://github.com/pypa/pipenv)
- [How to migrate from Pipenv to uv](https://pydevtools.com/handbook/how-to/how-to-migrate-from-pipenv-to-uv.md)
- [Pipfile reference](https://pydevtools.com/handbook/reference/pipfile.md)
- [What is a lockfile?](https://pydevtools.com/handbook/explanation/what-is-a-lock-file.md)
