简体   繁体   English

运行气流 initdb 时无法导入名称“IncorrectSchemaTypeError”

[英]cannot import name 'IncorrectSchemaTypeError while running airflow initdb

I'm running with:我正在运行:

ubuntu 18.04.4 LTS
python 3.6.9

I install aitflow with:我使用以下命令安装 aitflow:

pip install apache-airflow

and tried to init the db:并尝试初始化数据库:

airflow initdb

And get the following error:并得到以下错误:

Traceback (most recent call last):
  File "/usr/local/bin/airflow", line 26, in <module>
    from airflow.bin.cli import CLIFactory
  File "/home/ubadmin/.local/lib/python3.6/site-packages/airflow/bin/cli.py", line 71, in <module>
    from airflow.www_rbac.app import cached_app as cached_app_rbac
  File "/home/ubadmin/.local/lib/python3.6/site-packages/airflow/www_rbac/app.py", line 27, in <module>
    from flask_appbuilder import AppBuilder, SQLA
  File "/home/ubadmin/.local/lib/python3.6/site-packages/flask_appbuilder/__init__.py", line 5, in <module>
    from .api import ModelRestApi  # noqa: F401
  File "/home/ubadmin/.local/lib/python3.6/site-packages/flask_appbuilder/api/__init__.py", line 14, in <module>
    from marshmallow_sqlalchemy.fields import Related, RelatedList
  File "/home/ubadmin/.local/lib/python3.6/site-packages/marshmallow_sqlalchemy/__init__.py", line 4, in <module>
    from .schema import TableSchemaOpts, ModelSchemaOpts, TableSchema, ModelSchema
  File "/home/ubadmin/.local/lib/python3.6/site-packages/marshmallow_sqlalchemy/schema/__init__.py", line 3, in <module>
    from .sqlalchemy_schema import (
  File "/home/ubadmin/.local/lib/python3.6/site-packages/marshmallow_sqlalchemy/schema/sqlalchemy_schema.py", line 7, in <module>
    from ..exceptions import IncorrectSchemaTypeError
ImportError: cannot import name 'IncorrectSchemaTypeError

How can I fix it ?我该如何解决?

Got the same failure.得到了同样的失败。

Fixed it by reinstalling airflow with contraints, like mentioned in the official docs: https://airflow.apache.org/docs/stable/installation.html通过重新安装带有约束的气流来修复它,如官方文档中所述: https : //airflow.apache.org/docs/stable/installation.html

AIRFLOW_VERSION=1.10.12
PYTHON_VERSION="$(python --version | cut -d " " -f 2 | cut -d "." -f 1-2)"
CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VERSION}.txt"

# For example: 3.6
# https://raw.githubusercontent.com/apache/airflow/constraints1.10.12/constraints-3.6.txt

pip install "apache-airflow==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"

暂无
暂无

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

相关问题 虽然气流initdb,ImportError:无法导入名称HiveOperator - While airflow initdb, ImportError: cannot import name HiveOperator airflow initdb:ImportError:无法导入名称“HTMLString” - airflow initdb: ImportError: cannot import name 'HTMLString' airflow initdb:无法从“钟摆”导入名称“钟摆” - airflow initdb: cannot import name 'Pendulum' from 'pendulum' 在iMac上安装Apache-Airflow-Airflow InitDB-ImportError:无法导入名称对象 - Install Apache-Airflow on iMac - airflow initdb - ImportError: cannot import name objects Docker 中的 airflow initdb 抛出 ImportError: cannot import name 'import_string' - airflow initdb in Docker throws ImportError: cannot import name 'import_string' airflow安装无法initdb - airflow install cannot initdb 运行 airflow initdb 引发错误“postgres”以解决:使用 airflow 元数据库的 postgres 的名称或服务未知 - Running airflow initdb raises error `"postgres" to address: Name or service not known` using postgres for airflow meta database 启动Airflow Webserver时:ImportError:无法导入名称EscapeFormatter - While starting Airflow Webserver : ImportError: cannot import name EscapeFormatter 启动气流调度程序时出错 - 无法从“celery.backends.base”导入名称“BaseKeyValueStoreBackend” - getting error while starting airflow scheduler - cannot import name 'BaseKeyValueStoreBackend' from 'celery.backends.base' Airflow 2 - ImportError:无法从“airflow.operators”导入名称“BashOperator” - Airflow 2 - ImportError: cannot import name 'BashOperator' from 'airflow.operators'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM