[PYTHON] Bulk update with pip (with confirmation)

Hello. "Batch update with pip" has been slightly expanded to check for bulk updates (``` [upgrade all? (Y / n)] `` I made it into a shell script with `).

pip_upgrade_all.sh


#!/bin/sh
PIP="pip"
OUTDATED=$(${PIP} list --format=columns --outdated | awk 'NR>=3 {print $1}')
[ -z "${OUTDATED}" ] && exit $?
echo "${OUTDATED}"
echo "[upgrade all? (y/n)]"
read -r KEYINPUT
if [ "${KEYINPUT}" = "y" ];then
  echo "${OUTDATED}" | xargs ${PIP} install --upgrade
fi
exit $?

The one-liner that runs without confirmation is

$ pip list --format=columns --outdated | awk 'NR>=3 {print $1}' | xargs pip install --upgrade

Recommended Posts

Bulk update with pip (with confirmation)
Bulk update of pip packages
Implementation of Bulk Update with mongo-go-driver
Update package with pip standard features only
PIL installation with pip
Installing packages with pip3
Error with pip install
Use pip with MSYS2
Install scikit.learn with pip
Bulk indent with Xcode
[Road to intermediate Python] Install packages in bulk with pip
Use pip with Jupyter Notebook
When moss with pip install
Update packages already installed with pip in user environment (non-su)
Install github repository with pip
How to update with SQLAlchemy?
How to do Bulk Update with PyMySQL and notes [Python]
Update submodule foreach with GitPython
[Python beginner] Update pip itself
Replace dictionary value with Python> update ()
Permission denied with pip install pyopenssl
Command installation destination with pip, easy_install
Remove all modules installed with pip
Manipulate colors with pip install color
Uninstall everything you installed with pip
Bulk Insert Pandas DataFrame with psycopg2
How to install mysql-connector with pip3
[Python Windows] pip install with Python version