Apache Airflow 2.2.0(Celery组件)安装报错:cattrs依赖版本冲突问题咨询
Let's break down what's happening here and how to fix it:
The Root Cause
When you try to install apache-airflow[celery]==2.2.0 while pinning cattrs==1.0.0, pip throws a conflict error because:
apache-airflow[celery] 2.2.0 requires
cattrs<1.7.0, ~=1.1when running on Python versions >3.6. Your specifiedcattrs==1.0.0falls outside this version range, which creates the dependency clash.
Solutions to Resolve the Conflict
Here are two straightforward fixes:
Relax the cattrs version constraint
Update your cattrs version spec to match Airflow's requirements. Use a range that fits both needs, like this:pip install apache-airflow[celery]==2.2.0 cattrs~=1.1,<1.7.0This tells pip to install a cattrs version that's at least 1.1.x but less than 1.7.0, which aligns perfectly with Airflow 2.2.0's dependency rules.
Remove the cattrs version pin entirely
If you don't have a strict requirement forcattrs==1.0.0, let pip handle dependency resolution automatically by omitting the version constraint:pip install apache-airflow[celery]==2.2.0Pip will pick a cattrs version that satisfies Airflow's requirements without any conflicts.
内容的提问来源于stack exchange,提问作者Krishna Pandey

