pip list --format=freeze > requirements.txt
#1
python -m pip freeze
pip freeze > requirements.txt
or
pip install pipreqs
pipreqs
# install
pip3 install pipreqs
# Run in current directory
python3 -m pipreqs.pipreqs .
# install
pip3 install pipreqs
# Run in current directory
pipreqs <pathProject>.
pip install pipreqs
pipreqs