pip assists in creating requirements.txt files by providing the freeze option.
pip freeze > requirements.txt
This will save a list of all packages and their version installed on the system to a file named requirements.txt in the current folder.