"ImportError: cannot import name use" Error in Google Drive SDK Quick Launch Example

When I try to quickly launch the Google Drive SDK example, I get the following error message ( https://developers.google.com/drive/quickstart ).

Traceback (most recent call last): File "quickstart.py", line 6, in <module> from apiclient.discovery import build File "build/bdist.macosx-10.6-intel/egg/apiclient/discovery.py", line 45, in <module> File "build/bdist.macosx-10.6-intel/egg/apiclient/errors.py", line 26, in <module> ImportError: cannot import name util 

As explained in the tutorial, first on my Mac I terminal:

 easy_install --upgrade google-api-python-client 

I am using Mac OS 10.7.4 python 2.7.2

+6
source share
1 answer

I recommend using pip instead of easy_install . According to this answer to a similar question, most likely the client libraries and the oauth2client libraries oauth2client incompatible. It is best to upgrade with pip install -U google-api-python-client (or pip3 for Python 3).

After you get started with a quick start, if you want to see some longer, more β€œreal” examples of using the Drive API, here are some videos and blog posts I made for you:

(*) - TL; DR: Download a plain text file to disk, import / convert to Google Docs format, and then export this document as a PDF. The post above uses Drive API v2; this follow-up post describes porting it to the Drive API v3, and here is the developer’s video combining the bad man messages.

+2
source

Source: https://habr.com/ru/post/926164/


All Articles