airflow db init 在设置时未向数据库添加必要的文件

问题描述 投票:0回答:1

这是我收到的错误。我没有看到我手动创建的气流目录中创建的任何文件: '''

(airflow_env) vk@Vivians-Air airflow % airflow db init
/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/airflow/cli/commands/db_command.py:48 DeprecationWarning: `db init` is deprecated.  Use `db migrate` instead to migrate the db and/or airflow connections create-default-connections to create the default connections
DB: sqlite:////Users/vk/airflow/airflow.db
[2024-07-01T23:24:07.800-0400] {migration.py:215} INFO - Context impl SQLiteImpl.
[2024-07-01T23:24:07.801-0400] {migration.py:218} INFO - Will assume non-transactional DDL.
[2024-07-01T23:24:07.847-0400] {migration.py:215} INFO - Context impl SQLiteImpl.
[2024-07-01T23:24:07.847-0400] {migration.py:218} INFO - Will assume non-transactional DDL.
[2024-07-01T23:24:07.847-0400] {db.py:1625} INFO - Creating tables
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
WARNI [unusual_prefix_20fbaf03112d9fdd19d2f462cf464b4a138540ea_example_local_kubernetes_executor] Could not import DAGs in example_local_kubernetes_executor.py
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/airflow/example_dags/example_local_kubernetes_executor.py", line 38, in <module>
    from kubernetes.client import models as k8s
ModuleNotFoundError: No module named 'kubernetes'
WARNI [unusual_prefix_20fbaf03112d9fdd19d2f462cf464b4a138540ea_example_local_kubernetes_executor] Install Kubernetes dependencies with: pip install apache-airflow[cncf.kubernetes]
WARNI [unusual_prefix_a085edc763ae1834b77cd797514ae3fbde904ddd_example_kubernetes_executor] The example_kubernetes_executor example DAG requires the kubernetes provider. Please install it with: pip install apache-airflow[cncf.kubernetes]
WARNI [airflow.models.crypto] empty cryptography key - values will not be stored encrypted.
Initialization done

'''

python kubernetes terminal airflow
1个回答
0
投票

尝试创建一个干净的环境,安装有约束的气流:

pip install "apache-airflow==2.9.2" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.9.2/constraints-3.9.txt"

并安装提供程序包以使用此执行器

pip install "apache-airflow==2.9.2" apache-airflow-providers-cncf-kubernetes

OBS:根据你想要的airflow版本和python版本进行调整。

https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/stable/kubernetes_executor.html

© www.soinside.com 2019 - 2024. All rights reserved.