Pipenv brings together pip and virtualenv into a single tool that manages your project's dependencies the way you actually think about them. No more juggling requirements.txt files and manually activating virtual environments.
$ uv add pipenv
What It Looks Like
# Start a new project.
$ pipenv install requests
# Pipenv creates a virtual environment, installs the package,
# and generates both Pipfile and Pipfile.lock automatically.
# Add a dev dependency.
$ pipenv install pytest --dev
# Activate the environment.
$ pipenv shell
# Run a command inside the environment.
$ pipenv run python app.py
# Install from an existing Pipfile.
$ pipenv install
# See your dependency graph.
$ pipenv graph
# Check for known security vulnerabilities.
$ pipenv check
Every command does what you'd guess it does. No memorizing activation scripts. No wondering which requirements.txt is current.
The Pipfile
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
[packages]
requests = "*"
flask = ">=2.0"
[dev-packages]
pytest = "*"
black = "*"
[requires]
python_version = "3.11"
Human-readable. Version-controlled. The Pipfile.lock beside it captures exact versions with hashes for deterministic, verified builds. You edit the Pipfile. Pipenv manages the lockfile.
The Problem It Solved
Before Pipenv, the Python dependency workflow looked like this: create a virtualenv manually, activate it (differently on every OS), pip install things, remember to pip freeze > requirements.txt, hope your colleagues have the same versions, discover they don't, debug for an hour. The tools worked. The workflow was hostile.
Pipenv replaced all of that with a single command-line tool. Pipfile replaced requirements.txt with something readable. Pipfile.lock gave Python deterministic builds, the way npm and Ruby's Bundler had for years. Hash verification meant you could trust your dependencies hadn't been tampered with.
The Python Packaging Authority adopted it as a recommended tool. It wasn't a technical breakthrough. It was a workflow breakthrough. The same philosophy behind Requests: if developers keep making the same mistakes, the tool is wrong, not the developers.
The Legacy
Today, uv from Astral is Pipenv's spiritual successor. It solves the same problems faster, with a broader scope, and it's built by a team rather than a single maintainer. That's a good thing. The ideas Pipenv introduced live on in better implementations: unified dependency management, lockfiles for Python, developer experience as a first-class concern.
That's exactly how open source should work. You plant a flag that says "this experience is unacceptable." Others build something better. The ecosystem improves. The flag stays planted.
Install
$ uv add pipenv
Resources
History
Before pipenv, Python packaging was a scavenger hunt. You needed pip for installing packages, virtualenv for isolating environments, a requirements.txt for tracking dependencies (with no distinction between direct and transitive), and manual activation of virtual environments. Four tools, four mental models, no integration. Deployment was a prayer that pip freeze > requirements.txt captured the right state.
One tool. One workflow. Automatic virtualenv management, deterministic builds through Pipfile.lock, and a clean separation between what you asked for (Pipfile) and what you got (Pipfile.lock).
pipenv introduced Pipfile as a replacement for requirements.txt. Where requirements.txt was a flat list mixing direct dependencies with transitive ones, Pipfile distinguished between [packages] (what your app needs) and [dev-packages] (what your development process needs). Pipfile.lock provided deterministic, hash-verified builds, the same guarantee that npm's package-lock.json brought to JavaScript.
The pipenv development period was intense: 20+ hours a day for over 4 weeks, multiple releases per day, manic energy channeled into code. Kenneth was briefly recommended by the PyPA as the official packaging tool for Python.
"I'd rather go manic over a codebase than over magic/crystals/the cosmos. This was a very healthy expression for me."
The hypomanic productivity wasn't a warning sign to anyone around him. It was a feature. The open source community celebrates output without asking what it costs to produce.
pipenv raised the floor for what Python packaging should feel like. Before pipenv, fragmented workflows were accepted as normal. After pipenv, developers expected integrated tooling. Even after its decline, the expectations it set, automatic virtualenvs, lock files, unified CLI, became the baseline that every successor had to meet.
Transferred to the Python Packaging Authority (PyPA) for community stewardship.
Related
- Requests: The library whose philosophy Pipenv extends to packaging.
- The Lego Bricks Era: The era of Python tooling that produced Pipenv.
- From HTTP to Consciousness: How "for humans" became a design philosophy.
- The Maintainer Is the Interface: What maintaining widely-used tools taught me.