googleworkspace / python-samples

🐍 Python samples for Google Workspace APIs
Apache License 2.0
1.22k stars 900 forks source link

ImportError: cannot import name InstalledAppFlow #110

Open RenzoBertocchi opened 5 years ago

RenzoBertocchi commented 5 years ago

Expected Behavior

run

Actual Behavior

Traceback (most recent call last): File "google.py", line 5, in from google_auth_oauthlib.flow import InstalledAppFlow File "/Library/Python/2.7/site-packages/google_auth_oauthlib/flow.py", line 62, in import google.oauth2.credentials File "/Library/Python/2.7/site-packages/google/oauth2/credentials.py", line 42, in from google.oauth2 import _client File "/Library/Python/2.7/site-packages/google/oauth2/_client.py", line 35, in from google.auth import jwt File "/Library/Python/2.7/site-packages/google/auth/jwt.py", line 53, in from google.auth import _service_account_info File "/Library/Python/2.7/site-packages/google/auth/_service_account_info.py", line 22, in from google.auth import crypt File "/Library/Python/2.7/site-packages/google/auth/crypt/init.py", line 39, in from google.auth.crypt import rsa File "/Library/Python/2.7/site-packages/google/auth/crypt/rsa.py", line 27, in from google.auth.crypt import _python_rsa File "/Users/mrcsvberto/google.py", line 5, in from google_auth_oauthlib.flow import InstalledAppFlow ImportError: cannot import name InstalledAppFlow

Steps to Reproduce the Problem

python quickstart.py

Specifications

asrivas commented 5 years ago

Which quickstart is this for? Were you able to install the required libraries? See step 2 in this quickstart: https://developers.google.com/drive/api/v3/quickstart/python

pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib

RenzoBertocchi commented 5 years ago

Did all steps but got that error following this: https://developers.google.com/admin-sdk/directory/v1/quickstart/python

asrivas commented 5 years ago

Can you try installing pyopenssl? https://stackoverflow.com/questions/14063124/importerror-cannot-import-name-signedjwtassertioncredentials

successanil commented 5 years ago

Hi . I am also getting the same error when I am using python script to upload file to google drive.. Few months back it used to work. [python quickstart.py]

Now when I did

python3 quickstart.py

it worked.

samavan commented 4 years ago

Same error... All installed properly but still... @asrivas installed pyopenssl as mentioned but still :( install1 error1

Using pycharm.

Marcustks commented 4 years ago

Pls, try this pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib

stakepool247 commented 3 years ago

same error: from google_auth_oauthlib.flow import InstalledAppFlowp ImportError: cannot import name 'InstalledAppFlowp' from 'google_auth_oauthlib.flow'

installed all dependencies as requested per doumentation

gzemlevskiy17 commented 3 years ago

Yep, getting this error as well, it works when running locally, but not when on the cloud. I've installed and update everything and followed the documentation.

gzemlevskiy17 commented 3 years ago

Actually, I ran the command pip3 install google-auth-oauthlib and the error disappeared!

Felix-Fang commented 2 years ago

It's possible there are multiple versions of python installed. You could try: python3.9 -m pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib. Python3.9 as an example.