gpt4 book ai didi

python - Apache Airflow : airflow initdb throws ModuleNotFoundError: No module named 'wtforms.compat'

转载 作者:行者123 更新时间:2023-12-05 01:58:09 25 4
gpt4 key购买 nike

在带有 python 3.9 的 Ubuntu 21.04 上,尝试安装 Airflow 。当我运行 airflow init db 命令时,抛出以下错误

File "", line 855, inexec_module File "", line 228, incall_with_frames_removed File "/home/user/USB/.venv/lib/python3.9/site-packages/airflow/migrations/versions/82b7c48c147f_remove_can_read_permission_on_config.py",line 29, in from airflow.www.app import create_app File "/home/user/USB/.venv/lib/python3.9/site-packages/airflow/www/app.py",line 24, in from flask_appbuilder import SQLA File "/home/user/USB/.venv/lib/python3.9/site-packages/flask_appbuilder/init.py",line 6, in from .base import AppBuilder # noqa: F401 File "/home/user/USB//.venv/lib/python3.9/site-packages/flask_appbuilder/base.py",line 8, in from .api.manager import OpenApiManager File "/home/user/USB//.venv/lib/python3.9/site-packages/flask_appbuilder/api/manager.py",line 8, in from flask_appbuilder.baseviews import BaseView File "/home/user/USB//.venv/lib/python3.9/site-packages/flask_appbuilder/baseviews.py",line 21, in from .forms import GeneralModelConverter File "/home/user/USB//.venv/lib/python3.9/site-packages/flask_appbuilder/forms.py",line 16, in from .fields import EnumField, QuerySelectField, QuerySelectMultipleField File"/home/user/USB//.venv/lib/python3.9/site-packages/flask_appbuilder/fields.py",line 6, in from wtforms.compat import string_types, text_type

我尝试单独安装 wtforms。

airflow 是用 pipenv 安装的

有什么想法吗?

谢谢

最佳答案

只需按照安装文档中的说明安装包含约束文件的 Airflow 。

Airflow 具有复杂的依赖关系和特定的安装方式,为了以一致的方式安装它,您需要使用约束。

https://airflow.apache.org/docs/apache-airflow/stable/installation.html#installation-script

关于python - Apache Airflow : airflow initdb throws ModuleNotFoundError: No module named 'wtforms.compat' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68687548/

25 4 0