If you want the requirements.txt to include only top dependencies you can use: pip list --not-required --format freeze > requirements.txt
pip list --not-required --format freeze > requirements.txt