Here's a small piece to bring a Python update all installed package implementations by PIP. Small series feel very good, now share to everyone, also for everyone to make a reference. Let's take a look at it with a little knitting.
The newer PIP already supports list--outdated, so record the new method:
Pip list--outdated--format=legacy |awk ' {print $} ' |xargs sudo-h pip install-upip3 list--outdated--format=legacy |a WK ' {print '} ' |xargs sudo-h pip3 install-u
format has two options, one is legacy and the other is columns. the latter will bring a table header:
Package Version Latest Type
-------------- ------- ------ -----
So choose the legacy format and use awk to take the first column.
In addition, many methods on the web are operating under root or sudo without-h, which can cause problems on some machines. Recommended use sudo-h, the specific effect please check the man manual for yourself.