Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ModuleNotFoundError: No module named 'google'

Once I am trying to use google search api it's showing me an error:

Traceback (most recent call last):
  File "C:\Users\Maor Ben Lulu\Desktop\Maor\Python\google\google_Bot.py", line 1, in <module>
    from google import google
ModuleNotFoundError: No module named 'google'

My code :

from google import google
import urllib.request
import time
from bs4 import BeautifulSoup

def google_scrape(url):
    thepage = urllib.request.urlopen(url)
    soup = BeautifulSoup(thepage, "html.parser")
#    print(soup.prettify())
    return soup.prettify()
### Rest of the code

I did:

pip install google

But still doesn't work.

like image 806
Prog AF Avatar asked Aug 27 '18 11:08

Prog AF


People also ask

How do I fix ModuleNotFoundError No module named Google?

Modulenotfounderror: no module named google ( Solution ) – The best way to solve this error is to use the pip package manager. It will fetch the executive binary files or wheel package and put them into the required location.


2 Answers

This will solve you issue But you have to do import google not from google import google

pip install --upgrade google-api-python-client
like image 197
Sachin Rajput Avatar answered Oct 08 '22 01:10

Sachin Rajput


Install below mentioned package

pip install google-cloud
like image 22
Darshit Shah Avatar answered Oct 07 '22 23:10

Darshit Shah