mirror of
https://github.com/kennethreitz/kennethreitz.org.git
synced 2026-06-05 22:50:17 +00:00
9e7d363648
New essay on physical modeling synthesis in pure Python — Karplus-Strong strings, tabla strokes, djembe cross-choking, Hammond organ drawbars. Software pages: - Responder: mention this site runs on it, link to colophon - All pages: change pip install to uv add Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
90 lines
3.6 KiB
Markdown
90 lines
3.6 KiB
Markdown
# Pipenv: Python Dev Workflow for Humans
|
|
|
|
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
|
|
|
|
```bash
|
|
# 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
|
|
|
|
```toml
|
|
[[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](/software/requests): if developers keep making the same mistakes, the tool is wrong, not the developers.
|
|
|
|
## The Legacy
|
|
|
|
Today, [uv](https://github.com/astral-sh/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 — unified dependency management, lockfiles for Python, developer experience as a first-class concern — live on in better implementations.
|
|
|
|
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
|
|
|
|
```bash
|
|
$ uv add pipenv
|
|
```
|
|
|
|
## Resources
|
|
|
|
- [Documentation](https://pipenv.pypa.io/)
|
|
- [Source Code on GitHub](https://github.com/pypa/pipenv)
|
|
- [Python Package Index](https://pypi.org/project/pipenv/)
|
|
|
|
## Related
|
|
|
|
- [**Requests**](/software/requests) — The library whose philosophy Pipenv extends to packaging.
|
|
- [**The Lego Bricks Era**](/essays/2026-03-18-values_i_outgrew_and_the_ones_that_stayed) — The era of Python tooling that produced Pipenv.
|
|
- [**From HTTP to Consciousness**](/essays/2025-08-27-from_http_to_consciousness) — How "for humans" became a design philosophy.
|
|
- [**The Maintainer Is the Interface**](/essays/2026-03-22-the_maintainer_is_the_interface) — What maintaining widely-used tools taught me.
|