python pip3 upgrade all packages code example
Example 1: update all pip packages
pip freeze | %{$_.split('==')[0]} | %{pip install --upgrade $_}
Example 2: pip install upgrade all
pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
Example 3: upgrading a pip package while importing it
pip install [package_name] --upgrade