模块未找到错误:没有名为'google'错误的模块

  • 本文关键字:模块 错误 google python
  • 更新时间 :
  • 英文 :


尝试使用google搜索api显示错误:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
5 import urllib
6 import time
----> 7 from google.colab import files
8 import io
9 
ModuleNotFoundError: No module named 'google'

我代码:

import json
import pandas as pd
import urllib
import time
from google.colab import files

result_json = json.loads(result)
print(result_json)
with open('result.json', 'w') as outfile:
json.dump(result_json, outfile)
files.download('result.json')

我:

pip install Google

看起来PyPI上名为google的包是由MarioVilas创建的我不确定这是否是你正在寻找的,但在Github repo中,你可以看到这个包实际上被命名为googlsearch

# Package metadata.
metadata = dict(
name='google',
provides=['googlesearch'],
requires=['beautifulsoup4'],
packages=['googlesearch'],
scripts=[join('scripts', 'google')],
package_data={'googlesearch': ['user_agents.txt.gz']},
include_package_data=True,
version="3.0.0",
description="Python bindings to the Google search engine.",
author="Mario Vilas",
author_email="mvilas@gmail.com",
url="http://breakingcode.wordpress.com/",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Environment :: Console",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules",
],
)

所以你需要安装google"但是<;import googlesearch>

最新更新