-->

Python - PIP Part 3: Upgrading and Uninstalling Packages

With PIP, you can not only install but also upgrade or uninstall packages to manage your environment's dependencies.

Example 1: Upgrading a Package

To upgrade an existing package to the latest version, use:

pip install --upgrade requests

Example 2: Uninstalling a Package

To uninstall a package, use the following command:

pip uninstall requests

You will be prompted to confirm the uninstallation.

Example 3: Uninstalling Multiple Packages

You can uninstall multiple packages at once:

pip uninstall numpy pandas matplotlib

Explanation:

PIP helps maintain an up-to-date and clean environment by allowing you to upgrade or remove unnecessary packages with a simple command.