Python HOW: Create requirements.txt Using pipenv

Gabriel Harris Ph.D.
2 min readMar 2, 2020
Photo by cottonbro from Pexels

A requirements.txt file lists all the Python dependencies required for a project. It’s a snapshot of all the packages you’ve used. You will need this for building a Docker image for example, or for creating Serverless Functions or Web Apps

What’s pipenv?

pipenv is currently the recommended dependency manager for collaborative projects by Python. It uses pip and virtualenv under the hood. However, unlike pip, it attempt to install sub-dependencies that satisfy all the requirements from core dependencies

Instilling pipenv

Run the following in your terminal for a user installation:

After installation, open a new terminal and run pipenv

--

--

Gabriel Harris Ph.D.

I’m an End-to-End Lead Data Scientist and Data Science Manager. My articles are love letters to my future self