Manage required ๐ #Python packages with requirements.txt
๐งต
"Requirements files" are files containing a list of items to be installed using pip install / A requirements.txt file is a file that lists all of the dependencies for a project.
> It allows you to easily install all the dependencies for your project in one go ๐ .
> It makes it easy to share your project with others, as they can simply install all the dependencies from the requirements.txt file.
> It can help you avoid dependency hell.
The pip freeze command is used to output all of the installed packages in requirements format.
[ x.y.z -> package versions ]
You can install the same dependencies on another system by running pip install -r requirements.txt
The -r flag tells pip to read the requirements.txt file and install all the dependencies listed in that file.
Listen to @calvinhp talk on "Tools for Setting Up Python on a New Machine" | @realpython podcast
[00:22:38] Creating "requirements.txt" files and moving from pipenv to piptools
youtu.be/3JxhdzWCMjU?t=1358