Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue on airflow initdb

Tags:

airflow

I just start using airflow and I used the command :

airflow initdb

to initiate the airflow db as the setup required. But I stumbled on the error :

import cattr File "/home/adrienb/anaconda3/lib/python3.8/site-packages/cattr/__init__.py", line 1, in <module> from .converters import Converter, GenConverter, UnstructureStrategy File "/home/adrienb/anaconda3/lib/python3.8/site-packages/cattr/converters.py", line 16, in <module> from attr import fields, resolve_types ImportError: cannot import name 'resolve_types' from 'attr' (/home/adrienb/anaconda3/lib/python3.8/site-packages/attr/__init__.py)

Any ideas ?

like image 953
Adrien Forbu Avatar asked Nov 18 '20 10:11

Adrien Forbu


People also ask

How do you change the Airflow of a database?

Airflow uses SQLAlchemy to connect to the database, which requires you to configure the Database URL. You can do this in option sql_alchemy_conn in section [database] . It is also common to configure this option with AIRFLOW__DATABASE__SQL_ALCHEMY_CONN environment variable.

Which is the default DB used by Airflow?

By default, Airflow uses SQLite, which is not intended for development purposes only. Airflow supports the following database engine versions, so make sure which version you have. Old versions may not support all SQL statements. If you plan on running more than one scheduler, you have to meet additional requirements.


1 Answers

It's a known issue will be fixed in 1.10.13 (PR) Since you are using Python 3.8 you should use (reference):

pip install apache-airflow==1.10.12 \
 --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-1.10.12/constraints-3.8.txt"
like image 166
Elad Kalif Avatar answered Sep 19 '22 18:09

Elad Kalif