To add to @Bryan Wyatt, it seems desirable (and intended) that PIP installed/upgraded items should take precedence over (likely older) APT installed packages. My system had the apt and pip paths reversed. It should be (ignoring other entries):
- '/usr/local/lib/python2.7/dist-packages' (where pip installs modules)
- '/usr/lib/python2.7/dist-packages' (where apt install modules)
Yet due to some unknown action I must have taken, these paths appeared in the opposite order for me (ignoring other entries):
- '/usr/lib/python2.7/dist-packages' (where apt install modules)
- '/usr/local/lib/python2.7/dist-packages' (where pip installs modules)
It turns out something I did added /usr/lib/python2.7/dist-packages to /usr/local/lib/python2.7/dist-packages/easy-install.pth. Simply removing the line from easy-install.pth fixed the misordering for me. /usr/lib/python2.7/dist-packages is still in my path, since it gets added at a later stage elsewhere.
As a side note, pprint will display your path nicer...ie:
$ python -c "import sys; import pprint; pprint.pprint(sys.path)"
['',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PILcompat',
'/usr/lib/python2.7/dist-packages/gtk-2.0',
'/usr/lib/python2.7/dist-packages/ubuntu-sso-client']