KevCaz's Website

Even if I do not frequently code in Python, my setup includes several packages of this programming language. While I was looking for a simple way to update all installed packages, I found this thread on stack overflow which helps me writing the following alias in my zsh profile:

alias updpy='for i in  $(pip list --outdated --format=columns |tail -n +3|cut -d" " -f1)
    do pip install --user $i --upgrade

Now, when I enter updpy in my Terminal, all installed Python packages are updated. Pretty sweet 😄! Note that if you are using Python more often that I do, you may benefit from installing the package manager Conda. With Conda, all you need to do is:

$ conda install package-name

to install a Python package, and:

$ conda update --all

to update all installed packages.