Skip to content

Instantly share code, notes, and snippets.

@aleksejalex
Created October 25, 2023 17:53
Show Gist options
  • Save aleksejalex/e6a386ab022426cda0d3d0cbf94a1931 to your computer and use it in GitHub Desktop.
Save aleksejalex/e6a386ab022426cda0d3d0cbf94a1931 to your computer and use it in GitHub Desktop.
simple terminal script to update all pip-packages that are installed (works perfectly inside PYENV ! )
#!/bin/bash
# List outdated Python packages
outdated_packages=$(pip list --outdated)
if [ -z "$outdated_packages" ]; then
echo "No outdated packages to upgrade."
else
echo "Upgrading packages..."
pip list --outdated --format=columns | tail -n +3 | cut -d" " -f1 | xargs -n1 pip install --upgrade
echo "All packages upgraded."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment