How to upgrade all installed Pip packages

Pip makes it convenient to install Python programs and modules from PyPI. One problem that I face with it is to upgrade all my installed packages.

  • pip help install seems to indicate that the --upgrade will upgrade all installed packages. But in reality it does not.

  • One way to solve this is to install the pip-tools package:

$ sudo pip install pip-tools
  • This package provides a pip-review tool that can be used to upgrade all installed packages:
$ sudo pip-review --auto --verbose

Tried with: pip-tools 0.3.6, Pip 7.1.0, Python 2.7.6 and Ubuntu 14.04

Advertisements

6 thoughts on “How to upgrade all installed Pip packages”

  1. Pingback: Simon Dujancourt
  2. Because there was no easy way for upgrading package by package, and updating the requirements.txt file, I wrote this pip interactive upgrader https://github.com/simion/pip-upgrader which also updates the versions in your requirements.txt file** for the packages chosen (or all packages).

    Installation

    pip install pip-upgrader
    

    Usage

    Activate your virtualenv (important, because it will also install the new versions of upgraded packages in current virtualenv).

    cd into your project directory, then run:

    pip-upgrade
    

    Advanced usage

    If the requirements are placed in a non-standard location, send them as arguments:

    pip-upgrade path/to/requirements.txt
    

    If you already know what package you want to upgrade, simply send them as arguments:

    pip-upgrade -p django -p celery -p dateutil
    

    If you need to upgrade to pre-release / post-release version, add --prerelease argument to your command.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s