3

I'm trying to use the python google-api-python-client for a Youtube Data API project but when I run the following line:

from apiclient.discovery import build

I get the following eror:

from apiclient.discovery import build ModuleNotFoundError: No module named 'apiclient.discovery'

import apiclient runs fine but importing discovery returns an error.

I already checked the top answers from ImportError: No module named apiclient.discovery, but to no avail.

When I run python --version: I get Python 3.7.6


I'm running MacOs Catalina

AaravM4
  • 380
  • 1
  • 4
  • 21

2 Answers2

2

Nevermind I fixed the issue by switching apiclient with googleapiclient

AaravM4
  • 380
  • 1
  • 4
  • 21
0

you really should be using googleapiclient in your code, since the apiclient alias was just maintained as to not break legacy code.

incorrect method

from apiclient.discovery import build

correct method

from googleapiclient.discovery import build
GeoMonkey
  • 1,615
  • 7
  • 28
  • 56