我想使用YouTube数据API从视频中提取评论,为此我从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
答案 0 :(得分:0)
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