This is resolved in another thread: ImportError: No module named apiclient.discovery

Also this one worked in our case

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

Using python 3.6.5

Answer from Ananya_Chandraker on Stack Overflow
🌐
PyPI
pypi.org › project › google-api-python-client
google-api-python-client · PyPI
May 27, 2026 - Download the file for your platform. If you're not sure which to choose, learn more about installing packages. google_api_python_client-2.198.0.tar.gz (15.1 MB view details) ... Filter files by name, interpreter, ABI, and platform.
      » pip install google-api-python-client
    
Published   Jun 25, 2026
Version   2.198.0
🌐
GitHub
github.com › googleworkspace › python-samples › issues › 128
ModuleNotFoundError: No module named 'googleapiclient' · Issue #128 · googleworkspace/python-samples
September 14, 2019 - python vers:3.7 : package "googleapiclient" not installing. When installing this package i'm getting following error: Collecting googleapiclient Could not find a version that satisfies the requirement googleapiclient (from versions: ) No...
Author   googleworkspace
🌐
Reddit
reddit.com › r/learnpython › i am getting a moduleerror but unsure on how to fix it.
r/learnpython on Reddit: I am getting a ModuleError but unsure on how to fix it.
August 29, 2024 -

I am making a simple YouTube API call where I am getting the statistics of a YouTube channel to learn how to make API Calls.

I am using the Google Python API and have pip installed it into my working directory. I got the ModuleError and then by troubleshooting online I thought of making a virtual environment and installing the google api in there.

After creating the virtual environment and installing the Google API in there I ran the command pip list to make sure that it is in the virtual environment and I get the output:

(playlist_venv) C:\Users\User\OneDrive\Desktop\Playlist_Creator>pip list
Package                  Version
------------------------ --------
cachetools               5.5.0
certifi                  2024.7.4
charset-normalizer       3.3.2
google-api-core          2.19.2
google-api-python-client 2.142.0
google-auth              2.34.0
google-auth-httplib2     0.2.0
googleapis-common-protos 1.65.0
httplib2                 0.22.0
idna                     3.8
pip                      19.2.3
proto-plus               1.24.0
protobuf                 5.27.4
pyasn1                   0.6.0
pyasn1-modules           0.4.0
pyparsing                3.1.4
requests                 2.32.3
rsa                      4.9
setuptools               41.2.0
uritemplate              4.1.1
urllib3                  2.2.2
WARNING: You are using pip version 19.2.3, however version 24.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

My script is as so:

from googleapiclient.discovery import build
import os

api_key = os.environ.get("YT_API_KEY")
if not api_key:
    raise ValueError("YT_API_KEY environment variable not set")
# print(api_key)


youtube = build('youtube',
                'v3',
                developerKey=api_key)

request = youtube.channels().list(
    part='statistics',
    forUsername='******'
)

request = request.execute()

print(request)

And the output is:

(playlist_venv) C:\Users\User\OneDrive\Desktop\Playlist_Creator>python3 youtube_call.py
Traceback (most recent call last):
  File "C:\Users\User\OneDrive\Desktop\Playlist_Creator\youtube_call.py", line 9, in <module>
    from googleapiclient.discovery import build
ModuleNotFoundError: No module named 'googleapiclient'

What am I doing wrong to get this output?

🌐
Reddit
reddit.com › r/learnpython › modulenotfounderror: no module named 'googleapiclient'
r/learnpython on Reddit: ModuleNotFoundError: No module named 'googleapiclient'
August 25, 2020 -

This is my code I'm running in a Python3 Jupyter notebook:

from __future__ import print_function
import datetime
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools

import pandas as pd

I get this error:

ModuleNotFoundError: No module named 'googleapiclient'

pip freeze:

This is what I get from the command pip freeze:

apiclient==1.0.4
astroid==2.3.3
attrs==18.1.0
beautifulsoup4==4.7.1
cachetools==4.1.1
certifi==2020.6.20
chardet==3.0.4
colorama==0.4.3
ConfigArgParse==0.14.0
coursera-dl==0.11.4
cycler==0.10.0
entrypoints==0.3
google-api-core==1.22.1
google-api-python-client==1.10.0
google-auth==1.20.1
google-auth-httplib2==0.0.4
google-auth-oauthlib==0.4.1
googleapis-common-protos==1.52.0
httplib2==0.18.1
idna==2.10
isort==4.3.21
keyring==19.0.1
kiwisolver==1.2.0
lazy-object-proxy==1.4.3
matplotlib==3.3.0
mccabe==0.6.1
numpy==1.19.1
oauth2client==4.1.3
oauthlib==3.1.0
pandas==1.1.0
Pillow==7.2.0
protobuf==3.13.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pylint==2.4.4
pyparsing==2.4.7
python-dateutil==2.8.1
pytz==2020.1
pywin32-ctypes==0.2.0
requests==2.24.0
requests-oauthlib==1.3.0
rsa==4.6
selenium==3.141.0
six==1.15.0
soupsieve==1.9
typed-ast==1.4.1
uritemplate==3.0.1
urllib3==1.25.10
wrapt==1.11.2

I already tried:

  • pip install --force-reinstall google-api-python-client

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

  • Restarting my computer

  • Restart the Jupyter notebook kernel

  • When I try to use the command: "pip install googleapiclient", then I get this error:

ERROR: Could not find a version that satisfies the requirement googleapiclient (from versions: none)
ERROR: No matching distribution found for googleapiclient

What can I do?

🌐
Pinter Computing
pinter.org › archives › 10926
ModuleNotFoundError: No module named ‘googleapiclient’ – Pinter Computing
December 27, 2021 - Usually, we install the module with the pip install MODULE_NAME command, but when we try it for the googleapiclient we get the error message · ERROR: Could not find a version that satisfies the requirement googleapiclient (from versions: none) ERROR: No matching distribution found for googleapiclient · To install the googleapiclient Python module, use the command ... Argument of type '(number | null)[]' is not assignable to parameter of type '(err: Error, result: QueryResult) => void' June 20, 2026
🌐
YouTube
youtube.com › luke chaffey
ImportError: No module named googleapiclient.discovery - YouTube
python: ImportError: No module named googleapiclient.discoveryThanks for taking the time to learn more. In this video I'll go through your question, provide ...
Published   January 7, 2024
Views   399
Find elsewhere
🌐
DEV Community
dev.to › lameck_oluoch › handling-no-module-named-googleapiclient-in-jupyternotebook-using-python-4lei
Handling - No module named 'googleapiclient' in JupyterNotebook using Python - DEV Community
September 12, 2024 - Handling this error is quite easy, after a long struggle I found out that actually you can install the 'googleapiclient' within a jupyternotebook which contains the project you're working on.
🌐
GitHub
github.com › googleapis › google-api-python-client › discussions › 2329
Import "googleapiclient.discovery" could not be resolved · googleapis/google-api-python-client · Discussion #2329
Hello, I'm trying to get started with the YouTube Data API vs in Python but I'm getting: from googleapiclient.discovery import build ModuleNotFoundError: No module named 'googleapiclient'. google-a...
Author   googleapis
🌐
Google Groups
groups.google.com › g › google-appengine-stackoverflow › c › Nw2Hqo704C4
ImportError: No module named apiclient.discovery
from googleapiclient.discovery import build ImportError: No module named googleapiclient.discovery Please DO NOT REPLY directly to this email but go to StackOverflow: http://stackoverflow.com/questions/18267749/importerror-no-module-named-apiclient-discovery/37895911#37895911
🌐
RoseIndia
roseindia.net › answers › viewqa › pythonquestions › 111926-ModuleNotFoundError-No-module-named-googleapiclient.html
ModuleNotFoundError: No module named 'googleapiclient'
After the installation of googleapiclient python library, ModuleNotFoundError: No module named 'googleapiclient' error will be solved.
🌐
Itsourcecode
itsourcecode.com › home › modulenotfounderror: no module named ‘googleapiclient’ [solved]
Modulenotfounderror: no module named 'googleapiclient' [SOLVED]
March 8, 2023 - To use googleapiclient, you will need to have a Google account and enable the relevant APIs for your project in the Google Cloud Console. You can then install the library using pip, the Python package manager, and begin using it in your Python code. The Modulenotfounderror: no module named ‘googleapiclient‘ error message means that the Python module ‘googleapiclient’ could not be found or imported.
🌐
Reddit
reddit.com › r/learnpython › error no module named 'googleapiclient' even i already pip3 install
r/learnpython on Reddit: Error no module named 'googleapiclient' even I already PIP3 install
October 16, 2020 -

I tried many ways to PIP3 installed GooglePythonApi, but I still can't get away from this error

ModuleNotFoundError: No module named 'googleapiclient'

I have Anaconda installed in my Windows 10, this is the screenshot of the error in my Visual Studio Code.

Can somebody help?

🌐
GitHub
github.com › googleapis › google-api-python-client › issues › 1393
ModuleNotFoundError: No module named 'google.api_core' · Issue #1393 · googleapis/google-api-python-client
June 2, 2021 - Environment details Windows 10 Python 3.6.10 :: Anaconda, Inc. pip 20.2 google-api-python-client version 2.7.0 Steps to reproduce Download release 2.7.0. python setup.py build. python setup.py install. Run python. import apiclient raises...
Author   googleapis
🌐
Reddit
reddit.com › r/learnpython › import $$$$ could not be resolved error
r/learnpython on Reddit: Import $$$$ could not be resolved error
July 23, 2021 -

I'm getting the following error:

Import "googleapiclient.discovery" could not be resolved Pylance (reportMissingImports)

when I add the following line to my code:

from googleapiclient.discovery import build

The file structure is as follows:

YOUTUBEAPI\youtube_api\Lib\site-packages and YOUTUBEAPI\youtube_api\yt.py

I don't know how to draw directory tree in reddit, so mentioned like the above.

also, when I check the discovery.py file inside "googleapiclient" folder similar error is found for the following lines of code:

from six.moves import http_client
from six.moves.urllib.parse import urljoin

i.e. Import "six.moves" could not be resolved Pylance (reportMissingModuleSource) and Import "six.moves.urllib.parse" could not be resolved Pylance (reportMissingModuleSource)

Could somebody help me please?

🌐
ClassMethod
dev.classmethod.jp › articles › lambda_google_api_python_client
Python用Google APIクライアントライブラリのImportエラーが発生してしまう問題をなんとかする | DevelopersIO
March 26, 2020 - Response: null Request ID: "df60528a-90cf-4b50-a14c-XXXXXXXXX" Function Logs: START RequestId: df60528a-90cf-4b50-a14c-XXXXXXXXXVersion: $LATEST [WARNING] 2020-03-26T06:07:01.330Z df60528a-90cf-4b50-a14c-XXXXXXXXX file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth Traceback (most recent call last): File "/opt/python/googleapiclient/discovery_cache/__init__.py", line 36, in autodetect from google.appengine.api import memcache ModuleNotFoundError: No module named 'google.appengine' During handling of the above exception, another exception occurred: Traceback (most recent c
🌐
DevCoops
devcoops.com › resolve-no-module-named-apiclient-discovery-in-python
Resolve: "No module named apiclient.discovery" in Python | DevCoops
November 20, 2022 - from googleapiclient.discovery import build · Related posts: Resolve: No module named oauth2client in Python. Resolve: “No module named <insert-package-name-here>” in Python. Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.
🌐
GitHub
github.com › conda-forge › google-api-python-client-feedstock › issues › 11
ModuleNotFoundError: No module named 'google' · Issue #11 · conda-forge/google-api-python-client-feedstock
March 9, 2018 - ModuleNotFoundError: No module named 'google'#11 · Copy link · gyaresu · opened · on Mar 9, 2018 · Issue body actions · Posting everything I can think of as useful here. It's worth noting that pip (from within the conda env) also succeeded at installing 1.6.5 (the latest) but still would not import. So googleapiclient is indeed installed.
Author   conda-forge