简体   繁体   English

无法设置气流,在“启动气流数据库”时出错

[英]Not able to setup airflow, getting error while "Initiating Airflow Database"

Not able to setup airflow, getting error while "Initiating Airflow Database" .无法设置气流,在“启动气流数据库”时出错。 I am getting the below error:我收到以下错误:

  File "/Library/Frameworks/Python.framework/Versions/3.8/bin/airflow", line 26, in <module>
    from airflow.bin.cli import CLIFactory
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/airflow/bin/cli.py", line 79, in <module>
    api_module = import_module(conf.get('cli', 'api_client'))  # type: Any
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/airflow/api/client/local_client.py", line 24, in <module>
    from airflow.api.common.experimental import delete_dag
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/airflow/api/common/experimental/delete_dag.py", line 25, in <module>
    from airflow.models.serialized_dag import SerializedDagModel
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/airflow/models/serialized_dag.py", line 32, in <module>
    from airflow.serialization.serialized_objects import SerializedDAG
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/airflow/serialization/serialized_objects.py", line 28, in <module>
    import cattr
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/cattr/__init__.py", line 2, in <module>
    from .converters import Converter, UnstructureStrategy
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/cattr/converters.py", line 3, in <module>
    from ._compat import (
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/cattr/_compat.py", line 86, in <module>
    from typing import _Union
ImportError: cannot import name '_Union' from 'typing' (/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/typing.py)

Is it something to do with the path?跟路径有关系吗?

This is a bug in cattrs with Python 3.8, open issue: https://github.com/Tinche/cattrs/issues/46这是 Python 3.8 中cattrs一个错误,未解决的问题: https : //github.com/Tinche/cattrs/issues/46

I would suggest using Python 3.7我建议使用 Python 3.7

I have re-created the issue using python 3.8 and looks like there is already patch code ready to released in newer version of airflow.我已经使用 python 3.8 重新创建了这个问题,看起来已经有补丁代码准备好在新版本的气流中发布。

Meanwhile i would recommend downgrading your python version to 3.7.x and re-running the airflow initdb command.同时,我建议将您的 python 版本降级到 3.7.x 并重新运行airflow initdb 命令。

(I have successfully installed airflow in my sandbox using python 3.7.7) (我已经使用 python 3.7.7 在我的沙箱中成功安装了气流)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM