Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

python

airflow

On Ubuntu 21.04 with python 3.9, trying to install airflow. When I ran airflow init db command, below error is thrown

File "", line 855, in exec_module File "", line 228, in call_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

I tried installing wtforms separately.

airflow was installing with pipenv

Any idea?

thanks

like image 893
Tlaloc-ES Avatar asked Feb 02 '26 09:02

Tlaloc-ES


1 Answers

Just install airflow including constraints files as explained in installation documentation.

Airflow has complex dependencies and specific way of installation and in order to install it.in consistent way, you need to use constraints.

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

like image 82
Jarek Potiuk Avatar answered Feb 03 '26 23:02

Jarek Potiuk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!