How to prevent "ImportError: No module named oauth2client.client" on Google App Engine?

We are receiving an error:

ImportError: No module named OAuth2Client

We have noticed scores of questions around this topic, many unanswered and at least one answer that describes the solution of copying over files from the Google App Engine SDK.

This approach, however, seems tedious because all the dependencies are unclear. If we copy over oauth2client then run, the next error is another module that is missing. Fix that, then another module is missing, etc., etc.

What is ironic is that we can see all the files and modules needed, listed from Google App Engine SDK right in PyCharm but they seem inaccessible to the script.

Is there no better way to pull in all the files that oauth2client needs for Python to work on App Engine?

I have this problem and solved by installing oauth2client with pip3:

pip3 install --upgrade oauth2client 

Prevent Getting Sick, The following actions help prevent the spread of COVID-19, as well as other coronaviruses and influenza: Avoid close contact with people who are sick. Avoid​  16 coronavirus tips: How to help keep yourself healthy when going out in public. CNET Coronavirus Update. Keep track of the coronavirus pandemic. The risk of becoming seriously ill from COVID-19 won't go away until society Don't get too comfortable. Wear a face mask in public places. Don't make

As per the google-api-python documentation, try this

pip install --upgrade google-api-python-client oauth2client

Advice for public, Here are a few ways to prevent diseases and to take care of yourself so you “​For good health and disease prevention, avoid ultra-processed  prevent: [verb] to be in readiness for (something, such as an occasion). to meet or satisfy in advance. to act ahead of. to go or arrive before.

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.

  1. 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.)

  2. Create an empty file called appengine_config.py in the same folder as your app.yaml file

  3. Add two lines to that appengine_config.py file:

    from google.appengine.ext import vendor vendor.add('lib')

  4. 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.

Preventing the spread of the coronavirus, Many people have high blood pressure, or are at risk for it. Learn how you may be able to prevent or treat it, with simple, healthy lifestyle  9 Ways to Prevent Kidney Stones 1. Stay hydrated Drinking more water is the best way to prevent kidney stones. If you don’t drink enough, your urine 2. Eat more calcium-rich foods The most common type of kidney stone is the calcium oxalate stone, leading many people to 3. Eat less sodium A

Install WHL file

pip install oauth2client-4.1.3-py2.py3-none-any.whl

9 Ways to Prevent Disease (and To Live Your Healthiest Life , There are many steps a person can take to help prevent the spread of coronavirus, including frequent hand-washing and social distancing. 13 Tips to Stop and Prevent a Nosebleed Medically reviewed by Gerhard Whitworth, R.N. on March 4, 2019 — Written by Rachel Nall, RN, MSN, CRNA How to stop a nosebleed

Run this

sudo python -m pip install oauth2client

How to Prevent High Blood Pressure: MedlinePlus, This patient FAQ explains how to prevent sexually transmitted infections. Avoid risky sex practices—Sexual acts that tear or break the skin carry a higher risk of  How to Prevent Soil Erosion. Erosion is the loss of soil. As soil erodes, it loses nutrients, clogs rivers with dirt, and eventually turns the area into a desert. Although erosion happens naturally, human activities can make it much worse. Plant grass and shrubs. Bare soil is easily swept away by wind and water, the

6 Steps to Prevent COVID-19, Stop shaking hands and hugging people — for now. Similarly, avoid touching other people. Skin to skin contact can pass SARS-CoV-2 from one  To temporarily disable automatic updates on Windows 10, use these steps: Open Settings . Click on Update & Security . Click on Windows Update . Click the Advanced options button. Source: Windows Central. Under the "Pause updates" sections, use the Pause until drop-down menu, and select the time

Tips to prevent coronavirus transmission, Search for prevent that. Find Symptoms,Causes and Treatments of Afib.For Your Health.

How to Prevent Sexually Transmitted Infections (STIs), Limited Time Sale 15% Off All Items. Free Same Day Shipping

Comments
  • Thanks for your suggestion, I also had the import error. Solved it by putting the following in the Command Prompt pip install --upgrade oauth2client
  • Don't use pip's --user option or if will install to the wrong place. Especailly if you plan to deploy an app. Create and Activate a virtual env, then install it and check that oauth2client exists under (venv)/Lib/site-packages.
  • This seems to have worked for me, running Jeremy Blythe's Motion Uploader on Raspbian 8.
  • It's confusing that developers.google.com/api-client-library/python/guide/aaa_oauth says: "The oauth2client library is included with the Google APIs Client Library for Python." ...
  • using sudo pip is really a bad idea. you are messing up your whole system package manager. please don't do this.