So I just ran into this problem, and it turned out to be a problem for me. Of course, I know this is a little far-fetched (as each development environment is different), but writing it down here if it helps someone else.
TL; DR make sure that something does not reset your $PYTHONPATH .
Recall that when you do the βimportβ in python, python checks your sys.path for packages. This list has a priority order (i.e. if a package is found in an earlier path in the list, then this package will be used).
In my case, it looks like my $PYTHONPATH was changed when I made some appengine applications some time ago. As it turned out, my appengine had its own oauth2client lib, which is pretty old.
As a result, when python tried from oauth2client.service_account , it grabbed oauth2client in appengine, not oauth2client , which I expected it to oauth2client (the result of changing $PYTHONPATH ).
You can check if this happens to you by printing sys.path before calling the import:
import sys print sys.path from oauth2client.service_account import ServiceAccountCredentials
In my case, I could clearly see a bunch of application paths that took precedence. This led me to check my ~/.bash_profile , where wala I found this line:
export PYTHONPATH=$PYTHONPATH::$LOCAL_APPENGINE_HOME/lib/:$LOCAL_APPENGINE_HOME/lib/yaml/:$LOCAL_APPENGINE_HOME:$LOCAL_APPENGINE_HOME/lib/webapp2-2.5.2/`
Commented on this, started a new shell, and everything worked dandy.