The error message “no module named ‘google’” commonly specifies that the required Google API module is missing from your Python library installation.
It might doesn’t import correctly in your Python script.
Several programmers encounter this opposing error if it is trying out the Google API using the Python code?
Why the error no module named google occur?
The error no module named google occur because the python interpreter cannot find the library module installed google-api-python-client.
The most common source of this error is that you forget to installed the google-api-python-client in your python library.
Also read the other solved error: Modulenotfounderror: no module named _tkinter [SOLVED]
Furthermore, the error occurs if you have installed different versions of python on your computer.
The google-api-python-client is not installed in a specific version of python environment you are using.
Note: There is another error message which has similar to ModuleNotFoundError: No module named ‘google’ and the other one is ModuleNotFoundError: No module named ‘googleapiclient’.
Common reasons why this error occur:
Here are the multiple reasons why this error occurs:
- Missing or outdated dependencies
- Incorrect installation
- Incorrect environment configuration
- Using an unsupported version of Python
- Incorrect Spelling in module name
How to solve the Modulenotfounderror: no module named google
Time needed: 3 minutes
The “ModuleNotFoundError: No module named 'google'” error regularly occurs when you trying to import the google module in your Python code project.
Yet the module is haven’t been installed or cannot be found in the system. Here are some steps to solve the error:
- Step 1: Check the Installed Google APi
First, you need to check if you have installed the Google API client module library by running the following command in your terminal windows or command prompt(CMD):
pip show google-api-python-clientIf the system shows like this below, it means the google api is not installed
C:\Users\Dell>pip show google-api-python-client
WARNING: Package(s) not found: google-api-python-clientWhen the module google-api-python-client library is not installed, you can install it by running the following command:
pip install google-api-python-client![install google client in Modulenotfounderror no module named 'google' [SOLVED]](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNDgwIiBoZWlnaHQ9IjYwOSIgdmlld0JveD0iMCAwIDE0ODAgNjA5Ij48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBzdHlsZT0iZmlsbDojY2ZkNGRiO2ZpbGwtb3BhY2l0eTogMC4xOyIvPjwvc3ZnPg==)
- Step 2: Import Google Module in Correct Way
Second, Make sure that you are importing the correct Google module name. The correct import statement for the Google API client library is:
from googleapiclient.discovery import buildWhen you are importing the
googlemodule, you may try to change it to the correct import statement above. - Step 3: Installed in Correct Python Environment Variable
Third, You need to check your Python environment variable which is to make sure that you are using the correct specific version of Python.
That module is installed in the correct Python path environment. You can use the following command to check the Python version you’re using:
python --versionMake sure the version of Python is compatible with the module you’re using. When you are using path virtual environments, make sure that the module is installed in the correct or specific environment.
![show python version in Modulenotfounderror no module named 'google' [SOLVED]](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDY1IiBoZWlnaHQ9IjE0MiIgdmlld0JveD0iMCAwIDEwNjUgMTQyIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBzdHlsZT0iZmlsbDojY2ZkNGRiO2ZpbGwtb3BhY2l0eTogMC4xOyIvPjwvc3ZnPg==)
- Step 4: Configured the Python Interpreter Correctly
Finally, When you are using an IDE like a PyCharm, you make sure that you should configure the interpreter correctly and that the module is installed in the correct interpreter environment. You can check the interpreter settings in the IDE’s preferences or settings.
![python interpreter in Modulenotfounderror no module named 'google' [SOLVED]](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjE1IiBoZWlnaHQ9IjU2NiIgdmlld0JveD0iMCAwIDEyMTUgNTY2Ij48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBzdHlsZT0iZmlsbDojY2ZkNGRiO2ZpbGwtb3BhY2l0eTogMC4xOyIvPjwvc3ZnPg==)
- Step 5: Reinstall the Google Module
Last but not the least, if the error still persists, you can try to reinstall the module by running the following command below:
pip install --upgrade google-api-python-client![reinstall google client in Modulenotfounderror no module named 'google' [SOLVED]](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNDY4IiBoZWlnaHQ9IjU1MiIgdmlld0JveD0iMCAwIDE0NjggNTUyIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBzdHlsZT0iZmlsbDojY2ZkNGRiO2ZpbGwtb3BhY2l0eTogMC4xOyIvPjwvc3ZnPg==)
Frequently Asked Questions
Diagnostic checklist for “No module named ‘google'”
- Verify pip install target. Run
pip show google— if not installed, runpip install google. - Check the active Python interpreter.
which python(mac/Linux) orwhere python(Windows). Both pip and python must point to the same environment. - Check virtual environment activation. If you use venv/conda, activate before installing:
source .venv/bin/activate. - Rule out uppercase/lowercase. Python imports are case-sensitive:
import PyPDF2notimport pypdf2. - Rule out the pip-vs-package-name mismatch. Some packages install under a different name than you import (e.g.
pip install beautifulsoup4→import bs4).
Installing google
# Standard pip install pip install google # In a virtual environment (recommended) python -m venv .venv source .venv/bin/activate # or .venv\Scripts\activate on Windows pip install google # With uv (faster alternative) uv pip install google
Common causes for “No module named ‘google'”
- Python interpreter mismatch. Multiple Python installations can confuse pip. Verify with
which pythonandwhich pip. - Virtual environment not activated. If the venv isn’t activated, pip installs to your system Python instead.
- Notebook kernel mismatch. Jupyter uses a kernel that may differ from your terminal Python. Use
%pip install googleinside the notebook. - Import name differs from install name. pip install beautifulsoup4 → import bs4. Check the package’s PyPI page.
- Windows PATH issues. Ensure Python is on PATH; use
python -m pip installto invoke pip via the correct Python.
Working code example
# Verify install worked import google print(getattr(google, '__version__', 'no version attribute'))
Best practices
- Always use a virtual environment. Avoids most module-not-found errors.
- Use pip freeze to lock versions.
pip freeze > requirements.txtmakes your setup reproducible. - Consider uv or Poetry. Modern package managers with better dep resolution and reproducibility.
Official documentation
Featured guides worth reading next
What is Python ModuleNotFoundError and what causes it?
ModuleNotFoundError (a subclass of ImportError) is raised when Python cannot find the module you tried to import. Common causes: the package isn’t installed (pip install missing), wrong virtual environment activated, typo in module name, or Python can’t find your local module on the import path. The error message names exactly which module is missing.
How do I fix ‘ModuleNotFoundError: No module named X’?
Run pip install X first. If that succeeds but you still get the error, check which Python you’re using (which python OR python –version) vs which pip (which pip OR pip –version), they must match. Common gotcha: pip points to system Python 3.9 but you’re running python3.11 in a venv. Inside the venv, use python -m pip install X to be sure pip matches the active Python.
Why does my code work in one environment but not another?
Different Python versions or different installed packages. To diagnose: pip freeze > requirements.txt on the working environment, then pip install -r requirements.txt on the broken one. Use virtualenv (python -m venv venv) or conda for every project to avoid system-wide package collisions.
Is ModuleNotFoundError the same as ImportError?
ModuleNotFoundError is a subclass of ImportError added in Python 3.6. It specifically means ‘no such module exists.’ Plain ImportError covers a wider set: module exists but a name inside it can’t be imported (e.g. ‘cannot import name X from Y’). except ImportError catches both; except ModuleNotFoundError catches only the missing-module case.
Where can I find more ModuleNotFoundError fixes?
Browse the ModuleNotFoundError reference hub for 198+ specific module fixes (TensorFlow, Flask, Django, pandas, numpy, etc.). For related issues see ImportError. For broader Python setup see Python Tutorial hub.
Conclusion
In conclusion, I hope the solutions above can help you to solve the “ModuleNotFoundError: No module named 'google'” error you encountered.

![install google client in Modulenotfounderror no module named 'google' [SOLVED]](https://itsourcecode.com/wp-content/uploads/2023/03/install-google-client-in-Modulenotfounderror-no-module-named-google-SOLVED.png)
![show python version in Modulenotfounderror no module named 'google' [SOLVED]](https://itsourcecode.com/wp-content/uploads/2023/03/show-python-version-in-Modulenotfounderror-no-module-named-google-SOLVED.png)
![python interpreter in Modulenotfounderror no module named 'google' [SOLVED]](https://itsourcecode.com/wp-content/uploads/2023/03/python-interpreter-in-Modulenotfounderror-no-module-named-google-SOLVED.png)
![reinstall google client in Modulenotfounderror no module named 'google' [SOLVED]](https://itsourcecode.com/wp-content/uploads/2023/03/reinstall-google-client-in-Modulenotfounderror-no-module-named-google-SOLVED.png)