There's a module called pipreqs which is designed for creating the requirements file.
pip install pipreqs
pipreqs /GitHub/FolderName #Insert path to file
Add the location to the folder where the python files reside. Pipreqs will create a requirements.txt file in the folder.