Skip to content

Instantly share code, notes, and snippets.

@iamshreeram
Created August 3, 2019 20:37
Show Gist options
  • Select an option

  • Save iamshreeram/99ab6f19547787df8f51a9e79be8fb2d to your computer and use it in GitHub Desktop.

Select an option

Save iamshreeram/99ab6f19547787df8f51a9e79be8fb2d to your computer and use it in GitHub Desktop.
upgrade all python package
# Get the list of installed packages
pip3 freeze > req.txt
# Change the version from == to >=
sed -i 's/==/>=/g' req.txt
# Feed the packages one at a time and upgrade it
cat req.txt | sed -e '/^\s*#.*$/d' -e '/^\s*$/d' | sudo xargs -n 1 pip3 install --upgrade --ignore-installed --user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment