ImportError: No module named google.oauth2
Solution 1:
I've had this issue quite a bit. I uninstalled all Google packages from my local machine, deleted the lib folder in my GAE app folder, created it again then executed:
pip install -t lib google-auth google-auth-httplib2 google-api-python-client --upgrade
That should fix your problem.
Solution 2:
EDIT: I think you never get this error if you use something like virtualenv.
The problem was coming from the dependencies being installed in both the project folder (in the src/libs
folder), and in the python local libs folder (/usr/local/python2.7/dist-packages). I removed the google libraries from the python libs folder and it's now working again !
Solution 3:
Just upgrading some python packages solved my issue:
pip install --upgrade google-auth google-auth-httplib2 google-api-python-client
Solution 4:
I decided to use pipenv to solve this issue.
pip3 install pipenv
pipenv install
pipenv shell
Then install the libraries you need.