Created
October 25, 2023 17:53
-
-
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 ! )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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