Personal Catalogue: Django & PostgreSQL — Chapter 1, Exercise 2 ==================================================== TASK Explain the real, documented difference between psycopg2-binary and plain psycopg2, and why this project's own deadline makes the binary package the right choice for now. SOLUTION Both packages are Python adapters that let Django talk to a PostgreSQL database. The real difference is in how they're built and distributed. psycopg2 (the plain package) is compiled against your own system's installed PostgreSQL client libraries at install time. That means it needs those libraries, and a working C compiler toolchain, already present on whatever machine you're installing it onto — genuinely fiddly to set up correctly, especially on a machine that doesn't already have a PostgreSQL development environment configured. psycopg2-binary bundles its own precompiled copy of those same client libraries directly inside the installed package. It requires nothing extra on the target machine beyond running `pip install psycopg2-binary` - a real, meaningful reduction in setup friction, which is exactly why it's the officially recommended choice for local development and quick prototyping. The real, documented tradeoff is that psycopg2-binary is not recommended for production deployments. Bundling a self-contained copy of the client libraries can produce subtle version mismatches or duplicate-library conflicts in a production environment's own more tightly controlled dependency setup - a risk not worth taking once real, paying reliability is on the line, which is why the plain, system-linked psycopg2 package is the documented correct choice there instead. Given this project's own real deadline, the setup-friction savings from psycopg2-binary directly serve the goal of getting a working first release running quickly during development - with the plain psycopg2 package picked up specifically once Chapter 9's own deployment step is reached, not before. WHY THIS WORKS AS AN ANSWER ---------------------------- It explains the actual technical difference (bundled vs. system-linked client libraries) rather than treating the two package names as interchangeable, and ties the choice directly back to this project's own real time-pressure constraint rather than presenting it as an arbitrary preference.