pip3 freeze > requirements.txt 

Read more of this post