Install oauth2 Python package on Ubuntu 14.04

warning

This post is more than 5 years old. While math doesn't age, code and operating systems do. Please use the code/ideas with caution and expect some issues due to the age of the content. I am keeping these posts up for archival purposes because I still find them useful for reference, even when they are out of date!

The first assignment for Coursera's Introduction to Data Science focuses on sentiment analysis of twitter data. To do this the oauth2 package needs to be installed. Following the style outlined in my Install Python packages on Ubuntu 14.04 post, I will use pip to install the package as a user:

$ pip install --user oauth2

If we use pip show, we can set that the package is installed locally:

$ pip show oauth2
---
Name: oauth2
Version: 1.5.211
Location: /home/cstrelioff/.local/lib/python2.7/site-packages
Requires: httplib2

The required httplib2 package is not installed because this is already present in the default Python setup for Ubuntu 14.04:

$ pip show httplib2
---
Name: httplib2
Version: 0.8
Location: /usr/lib/python2.7/dist-packages
Requires:

Note the install location at /usr/lib/python2.7/dist-packages instead of /home/cstrelioff/.local/lib/python2.7/site-packages.