How to auto generate requrirements.txt for Python required pakcages for a project

requirements.txt is a text file including a set of dependencies that are required in order to make a python application to work. For example, it is important to deliver the requirements.txt when delivering your python code to someone to install required packages to run your code easily. 

 There are two tools such as 1) freeze and 2) pipreqs. However, freeze stores all packages in the environment of your code which might overinstall other ones that your code does not use. In contrast, pipreqs only stores the packages that are installed with pip install in your code environment.

$ pip install pipreqs
$ pipreqs /path/to/project