ModuleNotFoundError:没有名为“ google”的模块

时间:2018-08-27 11:59:45

标签: python

一旦我尝试使用Google Search API,它会向我显示错误

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'

我的代码:

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()
/// Continue of the code

我做了

pip install google

但仍然不起作用

3 个答案:

答案 0 :(得分:0)

安装以下提到的软件包

pip install google-cloud

答案 1 :(得分:0)

这将解决您的问题 但是您必须从Google导入google导入Go​​ogle

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

答案 2 :(得分:-1)

pip install google-cloud-bigquery