Forums

ModuleNotFoundError: No module named 'google_auth_oauthlib'

Hello guys I am trying to deploy one app here, I am using a virtualenv (activated already), I followed the normal procedures: 1. after start my virtualenv I had installed DJANGO 2. installed other requirements: pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib

When I am in the WEB menu and when I am reloading my site it is taking ages and in the end i get this message: "Your webapp took a long time to reload. It probably reloaded, but we were unable to check it. "

In the end my site do not open... :(

So I was wondering might be a google auth issue, so I wen to my files where I have the routine to authenticate and executed isolated... and then SURPRISE! I think I found the issue:

ModuleNotFoundError: No module named 'google_auth_oauthlib'

but I was checking using dir() method and I could find everything there!!

Can anyone tell how to fix this?

thanks in advance :)

Install the module: https://help.pythonanywhere.com/pages/InstallingNewModules/

Hello Glenn thank you for your help, but I did that and the problem remains... :( i could see that the module IS intalled already. I checked using dir() method.

just to show you up:

pip install google_auth_oauthlib Looking in links: /usr/share/pip-wheels Requirement already satisfied: google_auth_oauthlib in ./.virtualenvs/bejamasvirtualenv/lib/python3.8/site-packages (0.5.3) Requirement already satisfied: google-auth>=1.0.0 in ./.virtualenvs/bejamasvirtualenv/lib/python3.8/site-packages (from google_auth_oauthlib) (2.13.0) Requirement already satisfied: requests-oauthlib>=0.7.0 in ./.virtualenvs/bejamasvirtualenv/lib/python3.8/site-packages (from google_auth_oauthlib) (1.3.1) Requirement already satisfied: rsa<5,>=3.1.4 in ./.virtualenvs/bejamasvirtualenv/lib/python3.8/site-packages (from google-auth>=1.0.0->google_auth_oauthlib) (4.9) Requirement already satisfied: pyasn1-modules>=0.2.1 in ./.virtualenvs/bejamasvirtualenv/lib/python3.8/site-packages (from google-auth>=1.0.0->google_auth_oauthlib) (0.2.8) Requirement already satisfied: cachetools<6.0,>=2.0.0 in ./.virtualenvs/bejamasvirtualenv/lib/python3.8/site-packages (from google-auth>=1.0.0->google_auth_oauthlib) (5.2.0) Requirement already satisfied: six>=1.9.0 in ./.virtualenvs/bejamasvirtualenv/lib/python3.8/site-packages (from google-auth>=1.0.0->google_auth_oauthlib) (1.16.0) Requirement already satisfied: oauthlib>=3.0.0 in ./.virtualenvs/bejamasvirtualenv/lib/python3.8/site-packages (from requests-oauthlib>=0.7.0->google_auth_oauthlib) (3.2.2) Requirement already satisfied: requests>=2.0.0 in ./.virtualenvs/bejamasvirtualenv/lib/python3.8/site-packages (from requests-oauthlib>=0.7.0->google_auth_oauthlib) (2.28.1) Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in ./.virtualenvs/bejamasvirtualenv/lib/python3.8/site-packages (from pyasn1-modules>=0.2.1->google-auth>=1.0.0->google_auth oauthlib) (0.4.8) Requirement already satisfied: charset-normalizer<3,>=2 in ./.virtualenvs/bejamasvirtualenv/lib/python3.8/site-packages (from requests>=2.0.0->requests-oauthlib>=0.7.0->google auth_oauthlib) (2.1.1) Requirement already satisfied: certifi>=2017.4.17 in ./.virtualenvs/bejamasvirtualenv/lib/python3.8/site-packages (from requests>=2.0.0->requests-oauthlib>=0.7.0->google_auth_o authlib) (2022.9.24) Requirement already satisfied: idna<4,>=2.5 in ./.virtualenvs/bejamasvirtualenv/lib/python3.8/site-packages (from requests>=2.0.0->requests-oauthlib>=0.7.0->google_auth_oauthli b) (3.4) Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./.virtualenvs/bejamasvirtualenv/lib/python3.8/site-packages (from requests>=2.0.0->requests-oauthlib>=0.7.0->google_aut h_oauthlib) (1.26.12)

OK. Are you actually using that virtualenv in your web app?

Hello Glenn yes I am using that.

HI Glenn thank you for your help. I could solve this problem, but now I am facing other one: I am trying to access my google drive in this app i am deploying in pythonanywhere, and when I am running the script to authenticate it always return an auth-error. Can you tell me what kind of OAuth 2.0 should I use?

I'm afraid that I don't know. That's something that you will need to check the Google docs for.