We also have the possibility to create the requirements.txt file from the project source code.
For this task, we can use the pipreqs module, whose code can be downloaded from the GitHub repository at https://github.com/bndr/pipreqs
In this way, the module can be installed either with the pip install pipreqs command or through the GitHub code repository using the python setup.py install command.
To generate the requirements.txt file, you have to execute the following command:
pipreqs <path_project>