【问题标题】:Error while using the YouTube Data API使用 YouTube 数据 API 时出错
【发布时间】:2016-06-02 08:01:14
【问题描述】:

我想使用 YouTube 数据 API 从视频中提取 cmets,为此我有一个来自 Google 开发者页面的 API 服务器密钥。我的代码在 python 中。我根据官方文档here写了如下语句来实例化一个服务对象。

youtube = build('youtube', 'v3', developerKey='my_key')

但是,我收到以下错误:

user@laptop:~/projects/MLproject$ python scrape.py
WARNING:root:No module named locked_file
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/googleapiclient/discovery_cache/__init__.py", line 38, in autodetect
from . import file_cache
  File "build/bdist.linux-x86_64/egg/googleapiclient/discovery_cache/file_cache.py", line 32, in <module>
ImportError: No module named locked_file    

【问题讨论】:

    标签: python google-api youtube-api youtube-data-api


    【解决方案1】:

    python google API 客户端构建的 oAuth2 客户端最近引入了一些破坏 Google 库的更改。这是几天前发现的,并记录在这里:

    https://github.com/google/google-api-python-client/pull/182

    现在已经修复,并且可以使用新版本的 python API 库(版本 1.5):

    https://github.com/google/google-api-python-client/releases/tag/v1.5.0

    【讨论】:

      猜你喜欢
      • 2018-01-05
      • 2014-09-10
      • 2020-08-09
      • 2015-12-10
      • 2019-08-22
      • 1970-01-01
      • 2022-07-27
      • 2019-07-08
      • 2021-03-02
      相关资源
      最近更新 更多