I was running PuppyAgent’s API service locally. Its code uses from dotenv import load_dotenv to read the project’s .env configuration file. Install whatever’s missing, right? I typed pip install dotenv.
Looking back through my terminal history, I guessed four times. First dotenv, then dotenv-binary, then back to dotenv. On the fourth try I finally got it: python-dotenv. The best part is that the answer had been sitting in the project’s requirements.txt the whole time.
That afternoon I opened a GitHub issue. The person who filed it had also typed pip install dotenv. As luck would have it, PyPI really does have a project by that name. pip found dotenv-0.0.5.tar.gz and got as far as a build dependency error. Someone in the thread had even started to suspect setuptools. The maintainer, theskumar, had a short reply.1
@VrushankiPatel The install command for this library is
pip install python-dotenvand not
pip install dotenvCheers!
It turns out each name belongs to a different step. pip looks up the distribution name, python-dotenv, to find the package to install. Once it’s installed, Python can find it under the name in the code, dotenv. You’d be hard pressed to guess the python- prefix from that import line alone.2
When I checked again later, “Cheers!” had collected 58 👍, 2 😄, 5 🎉, and 1 ❤️. If GitHub ever adds an “I installed dotenv-binary too” button, I know who can cast the first vote.
Footnotes
-
VrushankiPatel. (2023, July 7). Installing backend dependencies error [Issue #472]. GitHub. Original issue and installation log. Kumar, S. [theskumar]. (2023, July 10). Maintainer’s full reply and reactions. GitHub. Reaction counts as displayed on November 20, 2026. ↩
-
Python Packaging Authority. (n.d.). Distribution package vs. import package. Python Packaging User Guide. Distribution and import names. ↩