1. Check the version of package
Use pip show YOUR_PACKAGE_NAME
to check the version of package,
su-macbook:tmp sparkandshine$ pip show matplotlib
Name: matplotlib
Version: 1.3.1
Summary: Python plotting package
Home-page: http://matplotlib.org
Author: John D. Hunter, Michael Droettboom
Author-email: mdroe@stsci.edu
License: BSD
Location: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
Requires: numpy, python-dateutil, tornado, pyparsing, nose
Or use pip freeze | grep 'YOUR_PACKAGE_NAME'
,
$ pip freeze | grep 'matplotlib'
matplotlib==1.3.1
2. Upgrade
Use sudo pip install [package] --upgrade
to upgrade the package,
$ sudo pip install matplotlib --upgrade
Password:
The directory '/Users/sparkandshine/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/sparkandshine/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, yo
Add the parameter --ignore-installed six
, then we have,
$ sudo pip install matplotlib --upgrade --ignore-installed six
...
Installing collected packages: pytz, six, cycler, python-dateutil, pyparsing, numpy, matplotlib
Successfully installed cycler-0.10.0 matplotlib-1.5.3 numpy-1.11.2 pyparsing-2.1.10 python-dateutil-2.5.3 pytz-2016.7 six-1.10.0
Check the version,
$ pip freeze | grep 'matplotlib'
matplotlib==1.5.3