python - 模块 'six.moves' 没有属性 'collections_abc'

标签 python google-api airflow six

我有一个连接到 YouTube API 版本 3 并检索公共(public)数据的脚本。这个脚本部署在 Airflow 中,它工作了一个月,今天它失败了,下面一行显示了这条消息:

def youtube_search(term,region):
        youtube = build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, developerKey=DEVELOPER_KEY,cache_discovery=False)
 File "/usr/local/airflow/.local/lib/python3.6/site-packages/googleapiclient/discovery.py", line 455, in build_from_document
    if isinstance(client_options, six.moves.collections_abc.Mapping):
AttributeError: module 'six.moves' has no attribute 'collections_abc'
我去查看455th上线 discovery.py
if isinstance(client_options, six.moves.collections_abc.Mapping):
        client_options = google.api_core.client_options.from_dict(client_options)
six module很长一段时间没有改变,我的脚本也没有部署在 Airflow 中,配置也没有改变。
Google模块导入 six ,它没有改变,我不知道为什么我会随机得到这个错误?

最佳答案

您是明确指定您正在使用的 google-api-python-client 版本,还是仅使用可用的最新版本?
2020 年 9 月 14 日发布了一个新版本 (v1.12.0),随后是一个错误修复版本 v.1.12.1,它修复了与对 six 的依赖相关的错误。模块。 (来自 GitHub 的发布说明:需要六个>=1.13.0 (#1030) (4acecc3))
您可能会遇到 v1.12.0 中的错误。

关于python - 模块 'six.moves' 没有属性 'collections_abc',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63902467/

相关文章:

python - 如何使用 Brew 安装旧配方?

python - 如何在Python中将子图图形绘制并保存为新的类方法?

google-analytics - 如何从Google Analytics(分析)API中获取非抽样数据-即使是一天?

python 前夕 : fields not returned in default configuration

python - 我如何获得所有连接?

google-api - 在折线图上显示线和点 - Google Visualization API

php - Google Drive API 日期/时间

Airflow 资源利用率飙升

python - 如何在特定日期的特定时间运行 Airflow?

mysql - Airflow 1.10.0 通过 Ansible