This Python script automates the process of upgrading pip
and updating all outdated packages installed via pip
.
- Upgrade Pip: Checks the current version of
pip
and 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
pip
version. - Upgrades
pip
to the latest version. - Displays the new
pip
version.
- 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.