Updating all python package with anaconda

Updating anaconda packages

All packages managed by conda can be updated with the following command :

conda update --all

Updating other packages with pip

For the other packages, the pip package manager can be used. Unfortunately pip hasn't the same update all fonctionnality.

import pip
from subprocess import call

for dist in pip.get_installed_distributions():
    print("updating {0}".format(dist))
    call("pip install --upgrade " + dist.project_name, shell=True)