How to prevent "ImportError: No module named oauth2client.client" on Google App Engine?
I have this problem and solved by installing oauth2client
with pip3
:
pip3 install --upgrade oauth2client
As per the google-api-python
documentation, try this
pip install --upgrade google-api-python-client oauth2client
The answer is to "vendor" in the file(s).
We found a quick way to solve this based on this documentation https://cloud.google.com/appengine/docs/python/tools/libraries27#vendoring and this SO answer.
Create a new folder called "lib" in the same folder as your app.yaml file. (You can name it something else. Just use that name below.)
Create an empty file called appengine_config.py in the same folder as your app.yaml file
Add two lines to that appengine_config.py file:
from google.appengine.ext import vendor vendor.add('lib')
From terminal, navigate to the directory which contains that file and execute the following command:
sudo pip install -t lib google-api-python-client
The import error will disappear and you will have all the sub-dependent modules as well.