This one got me confused when I was trying to run my python interpreter in my Terminal. I had to remove all packages installed by pip when my flask app wasn’t seeing my installed modules/packages for some crazy reason.

This was not the solution to the core problem in my case. The main problem was not being in the same environment where Flask is installed making it an environment mismatch. Anyways, I wanted to document how to remove all packages installed by pip. I am using a mac, so I’m using my Terminal.

Remove all packages with pip

I already had a requirements.txt. If you don’t you can run the below pip command to collect all installed packages:

pip freeze > requirements.txt

Remove one by one:

pip uninstall -r requirements.txt

Remove all packages in one command:

pip uninstall -r requirements.txt -y

After doing this I was able to start from scratch and then brew my favorite coffee at home using my Aeropress.

Leave a comment

Your email address will not be published. Required fields are marked *