8
votes

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 ?

2

2 Answers

16
votes

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"
1
votes

Looking at the same issue that Elad commented, in my case, adding only

pip install attrs==19.3.0
pip install cattrs==1.0.0

was enough to solve it