Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: cannot import name discovery

I am using Google's python API client, and one of the lines it wants you to use is:

from apiclient import discovery

When I run this it returns the error:

ImportError: cannot import name discovery

Note: the apiclient module is installed and up to date

Thanks guys

like image 823
Lewys Gardner Avatar asked Aug 03 '17 06:08

Lewys Gardner


2 Answers

At some point apiclient module name was changed. If you cannot import discovery from apiclient, then try:

from googleapiclient import discovery

Hope this helps.

like image 198
Michał Jabłoński Avatar answered Oct 21 '22 08:10

Michał Jabłoński


You should be able to get these dependencies with this simple install:

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

See also: https://stackoverflow.com/a/23521799/1115187

like image 9
Neeraj Avatar answered Oct 21 '22 08:10

Neeraj