Modulenotfounderror: no module named google ( Solved )

As you already know Google is a tech giant that provides you with many services like a search engine, emails, cloud server e.t.c. Do you know there is a python package for Google? Yes, it is google. If you are getting the error like modulenotfounderror: no module named google then this post is for you. In this entire tutorial, you will know how to solve the error modulenotfounderror: no module named google.

What is ModuleNotFoundError ?

Before going to the coding demonstration part. Let’s know why the error ModuleNotFoundError comes. There can be mostly two cases when you will get this error. Firstly, if You have not installed the module you are getting the error. Secondly, the path for the python is not defined.  In the next section, you will know how to solve this error.

Why modulenotfounderror: no module named google  comes

Most of the cases the no module named google comes when you have not installed the google python package in your system. To check if you have not installed the google module is to import the google package.

For example, if you try to import the google python package in pycharm then you will see the red underline below the word google. The python interpreter is clearly indicating the module has not been installed.

import google
No module named google error
No module named google error

The same case will be for the terminal or the command prompt. You will get the No module named google after importing the module.

No module named google error in command prompt
No module named google error in command prompt

How to fix the no module named google error

The solution for this modulenotfound error is very simple. You have to install the google module. To install you have to use the pip command. Also, you have to check the version of the python you have installed in your system.

If your system has a python 3. xx version then use the pip3 command and if the python version is 2. xx then use the pip command.

Use the below command to check the version of the python.

python --version
Checking the Python version
Checking the Python version

My system has python 3. xx version, therefore I will use the pip3 command.

Let’s install the google module using the below command.

pip3 install google
Installing the google module
Installing the google module

It will successfully install the google python module. Now if you again import the package you will not get the modulenotfounderror: no module named google error.

Conclusion

There are many features provided by the google module. But it’s a headache for many coders if you are getting the modulenotfounderror: no module named google error. The above method will solve this error.

 

Code The Best
Hi, I am CodeTheBest. Here you will learn the best coding tutorials on the latest technologies like a flutter, react js, python, Julia, and many more in a single place.