我知道以前有人問過非常相似的問題,但我發現這些問題往往包括 Docker,我目前沒有使用,也沒有安裝。我被引導相信 WSL2 應該是 Docker 在 Windows 上運行 Airflow 的替代方案。
我在我的 Windows 11 筆記本電腦上使用 WSL2,并從以下鏈接的教程中安裝了 Apache-Airflow: https ://coding-stream-of-consciousness.com/2018/11/06/apache-airflow-windows-10 -安裝-ubuntu/
在 WSL2 上,我有:
- Python 版本 3.8.10
- 點子版本 20.0.2
- Apache-Airflow 2.4.1(我相信)
我已經運行了以下命令(根據教程)沒有問題:
sudo apt-get install software-properties-common
sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install python-pip
sudo pip install apache-airflow #I had path issues without 'sudo' command
但是,當我嘗試在 WSL2 Ubuntu 終端中使用“airflow”命令時,出現以下錯誤:
$ airflow
Unable to load the config, contains a configuration error.
Traceback (most recent call last):
File "/usr/lib/python3.8/logging/config.py", line 563, in configure
handler = self.configure_handler(handlers[name])
File "/usr/lib/python3.8/logging/config.py", line 744, in configure_handler
result = factory(**kwargs)
File "/usr/local/lib/python3.8/dist-packages/airflow/utils/log/file_processor_handler.py", line 45, in __init__
self.filename_template, self.filename_jinja_template = parse_template_string(filename_template)
File "/usr/local/lib/python3.8/dist-packages/airflow/utils/helpers.py", line 165, in parse_template_string
import jinja2
File "/usr/lib/python3/dist-packages/jinja2/__init__.py", line 33, in <module>
from jinja2.environment import Environment, Template
File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 15, in <module>
from jinja2 import nodes
File "/usr/lib/python3/dist-packages/jinja2/nodes.py", line 23, in <module>
from jinja2.utils import Markup
File "/usr/lib/python3/dist-packages/jinja2/utils.py", line 656, in <module>
from markupsafe import Markup, escape, soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.8/dist-packages/markupsafe/__init__.py)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/airflow", line 5, in <module>
from airflow.__main__ import main
File "/usr/local/lib/python3.8/dist-packages/airflow/__init__.py", line 46, in <module>
settings.initialize()
File "/usr/local/lib/python3.8/dist-packages/airflow/settings.py", line 564, in initialize
LOGGING_CLASS_PATH = configure_logging()
File "/usr/local/lib/python3.8/dist-packages/airflow/logging_config.py", line 74, in configure_logging
raise e
File "/usr/local/lib/python3.8/dist-packages/airflow/logging_config.py", line 69, in configure_logging
dictConfig(logging_config)
File "/usr/lib/python3.8/logging/config.py", line 808, in dictConfig
dictConfigClass(config).configure()
File "/usr/lib/python3.8/logging/config.py", line 570, in configure
raise ValueError('Unable to configure handler '
ValueError: Unable to configure handler 'processor'
我已經廣泛搜索了 ValueError,找不到任何不涉及 Docker 的明確解決方案。
任何對錯誤的見解將不勝感激!
uj5u.com熱心網友回復:
您應該使用約束安裝氣流。
https://airflow.apache.org/docs/apache-airflow/stable/installation/installing-from-pypi.html#installation-tools
這是保證氣流安裝作業的唯一方法。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/522099.html
