'Airflow No module named 'wtforms.compat'
recently i have been trying to install airflow on my Macbook pro( 2 GHz Quad-Core Intel Core i5)
However, i have been facing persistent problems in trying to create a virtual environment(venv) where i can install airflow.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/bin/airflow", line 26, in <module>
from airflow.bin.cli import CLIFactory
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airflow/bin/cli.py", line 82, in <module>
from airflow.www.app import (cached_app, create_app)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airflow/www/app.py", line 42, in <module>
from airflow.www.blueprints import routes
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airflow/www/blueprints.py", line 25, in <module>
from airflow.www import utils as wwwutils
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airflow/www/utils.py", line 36, in <module>
from wtforms.compat import text_type
ModuleNotFoundError: No module named 'wtforms.compat'
System Description: 1.Macbook pro( 2 GHz Quad-Core Intel Core i5) 2.Python Version (3.8.12)
Possible solutions:
I have installed airflow in accordance to the documentation
pip install "apache-airflow[celery]==2.2.3" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.2.3/constraints-3.8.txt"
I have tried most solutions here as well as airflow github issues. Most recommend reinstalling which i did as well. Some include changing wtforms == 2.3.3 but to no avail as well.
I have exhuasted most of my means i hope stackoverflow can guide me through this. Lastly, thank you in advance and i hope to learn from you
Solution 1:[1]
You are using Python 3.9 not python 3.8
File "/Library/Frameworks/Python.framework/Versions/3.9/bin/airflow", line 26, in <module>
Apparently for some reason you mixed those. You should make sure you both CREATE and ACTIVATE virtualenv and install airflow in the right virtualenv.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Jarek Potiuk |
