00:00 When you work with a virtual environment, and you only install the packages that you need for your project, you have a good chance of keeping the list of installed packages in your virtual environment tidy. Still, you may reach the point where you want to uninstall packages.
So here I am in my project folder. The virtual environment is not activated yet, so I activate it again with
activate, and I use
python3 -m pip list to show you what I have installed right now in my virtual environment.
requests, but it didn’t remove any of its dependencies. This behavior is a feature, not a bug. Imagine that you’ve installed several packages into your environment with
pip, some of which share dependencies.
pip uninstalled a package and its dependencies, then it would render any other packages requiring those dependencies unusable. So for now though, go ahead and remove the remaining packages by running
pip uninstall on them.
That means you successfully uninstalled all the packages that you installed with
pip. By the way, instead of uninstalling some or all installed packages of a virtual environment, you can also just delete the
venv folder, re-create a new virtual environment, and then install any packages that you need.
Become a Member to join the conversation.