At this stage, you managed to create your first Python project and saved all the packages used in a virtual environment. The next step is to collaborate with other data professionals. For a smooth collaboration with your peers, now you have to create a requirements.txt file with all the Python packages used and their respective versions.
Create the requirements.txt:
To automatically create the file, run the below line in the terminal:
pip freeze > requirements.txt
There are numerous situations when you’ll use a requirements.txt file:
- share a project with your peers;
- use a build system;
- copy the project to any other location;
- project documentation.
One more command line to remember for the first 3 situations:
pip install -r requirements.txt
It’s that simple!
This is a personal blog. My opinion on what I share with you is that “All models are wrong, but some are useful”. Improve the accuracy of any model I present and make it useful!