【问题标题】:Airflow 2.2.0 Install Error: package versions have conflicting dependencies cattrsAirflow 2.2.0 安装错误:包版本有冲突的依赖关系 cattrs
【发布时间】:2021-12-06 10:13:08
【问题描述】:

我在尝试按照https://airflow.apache.org/docs/apache-airflow/stable/installation/installing-from-pypi.html 的安装步骤时遇到错误

ERROR: Cannot install apache-airflow[celery]==2.2.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    apache-airflow[celery] 2.2.0 depends on cattrs<1.7.0 and ~=1.1; python_version > "3.6"
    The user requested (constraint) cattrs==1.0.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

【问题讨论】:

    标签: failed-installation airflow-2.x


    【解决方案1】:

    我在本地当前工作目录中复制了https://raw.githubusercontent.com/apache/airflow/constraints-2.2.0/constraints-3.6.txt 文件并将“cattrs==1.0.0”更改为“cattrs==1.1.0”

    然后使用下面的命令进行安装

    pip3 install --force-reinstall "apache-airflow[celery]==2.2.0" --constraint constraints.txt
    

    编辑:我后来意识到这个问题是由于使用了错误的约束文件版本。我在我的机器上安装了 Python 3.8,而我使用的是 constraints-3.6.txt 而不是 constraints-3.8.txt

    正确的命令应该如下:

    pip3 install "apache-airflow[celery]==2.2.0" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VERSION}.txt"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-01-02
      • 2022-08-24
      • 2012-05-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多