YouTube api 没有名为“googleapiclient.disocvery”的模块

问题描述 投票:0回答:1

我正在尝试使用 YouTube API。我需要安装 google api python 客户端并使用正确的命令。我正在尝试从终端进行 pip install,这是我正在使用的命令-

pip3 install --upgrade google-api-python-client

它成功运行代码并显示需求已满足。然而,当我回到 Jupyter Notebook 时,它不断抛出错误。

我运行的代码-

from googleapiclient.disocvery import build
import pandas as pd

我遇到错误-

ModuleNotFoundError                       Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_2792/1819596350.py in <module>
----> 1 from googleapiclient.disocvery import build
      2 import pandas as pd

ModuleNotFoundError: No module named 'googleapiclient.disocvery'

有什么想法我做错了什么吗?我在这里检查了以前的线程,建议是在终端上运行命令时使用 pip3 代替 pip,但我没有成功。

这是终端代码的最后一部分,表明满足要求。消息很长,我发最后一部分了-

Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in c:\users\qazws\appdata\local\programs\python\python38-32\lib\site-packages (from pyasn1-modules>=0.2.1->google-auth<3.0.0dev,>=1.19.0->google-api-python-client) (0.4.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\qazws\appdata\local\programs\python\python38-32\lib\site-packages (from requests<3.0.0dev,>=2.18.0->google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5->google-api-python-client) (2.0.8)
Requirement already satisfied: idna<4,>=2.5 in c:\users\qazws\appdata\local\programs\python\python38-32\lib\site-packages (from requests<3.0.0dev,>=2.18.0->google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5->google-api-python-client) (3.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\qazws\appdata\local\programs\python\python38-32\lib\site-packages (from requests<3.0.0dev,>=2.18.0->google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5->google-api-python-client) (1.26.7)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\qazws\appdata\local\programs\python\python38-32\lib\site-packages (from requests<3.0.0dev,>=2.18.0->google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5->google-api-python-client) (2021.10.8)
WARNING: You are using pip version 22.0.3; however, version 22.2.2 is available.
You should consider upgrading via the 'C:\Users\qazws\AppData\Local\Programs\Python\Python38-32\python.exe -m pip install --upgrade pip' command.

api module client google-api-discovery
1个回答
0
投票

您好像打错了

googleapiclient.disocvery
,正确的拼写是
googleapiclient.discovery

© www.soinside.com 2019 - 2024. All rights reserved.