pip 指令更新 python packages

Read Time:15 Second

更新一個已知名稱的 Python package,如 numpy package

pip install -U numpy

或是

pip install --upgrade numpy

更新所有已安裝的packages

pip list |awk '{print $1}' |xargs -n 1 pip install --upgrade

或是

for i in `pip list |awk '{print $1}'`; do echo $i; pip install --upgrade $i; done