Use below command –
pip freeze | xargs pip uninstall -y
If there are any packages which were installed usig VCS, then we will exclude those . And then will remove the packages
pip freeze | grep -v "^-e" | xargs pip uninstall -y
pip freeze > requirements.txt
pip uninstall -r requirements.txt
pip uninstall -r requirements.txt -y