gpt4 book ai didi

python - ModuleNotFoundError : No module named 'google'

转载 作者:行者123 更新时间:2023-12-03 17:32:02 26 4
gpt4 key购买 nike

一旦我尝试使用谷歌搜索 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

但还是不行

最佳答案

这将解决您的问题
但是你必须做 import google 而不是 from google import google

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

关于python - ModuleNotFoundError : No module named 'google' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52038874/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com