This Python script automates the process of upgrading pip and updating all outdated packages installed via pip.
- Upgrade Pip: Checks the current version of
pipand upgrades it if necessary. - List Outdated Packages: Retrieves a list of all outdated packages.
- Update Packages: Automatically updates all outdated packages to their latest versions.
Run the script using Python:
python script_name.py- Python 3.x
pip
The script performs the following steps:
-
Upgrade Pip:
- Displays the current
pipversion. - Upgrades
pipto the latest version. - Displays the new
pipversion.
- Displays the current
-
Get Outdated Packages:
- Retrieves a list of all outdated packages in JSON format.
-
Update Packages:
- Updates each outdated package to the latest version.