#pip freeze only works fine in virtual environment #first install >> pip3 install pipreqs #use command pipreqs /project_directory # it will automatically create requirements.txt (modules/lib in which was used your current project)