You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用pip download时版本完全匹配却出现安装冲突错误

问题:pip download依赖冲突异常(约束与指定版本一致仍报错)

我要通过pip download命令下载所有依赖的wheel包,打包成zip后上传到无法联网的服务环境中供运行使用。但执行命令时遇到了一个费解的错误:约束文件中指定的版本和我明确要求的版本完全一致(用==固定版本),却被提示存在依赖冲突。使用的约束文件为Apache Airflow 2.8.1对应Python 3.11的官方约束文件。

错误信息

python -m pip download -r requirements/requirements.txt -d plugins
Looking in links: /usr/local/airflow/plugins
WARNING: Location '/usr/local/airflow/plugins' is ignored: it is either a non-existing path or lacks a specific scheme.
ERROR: Cannot install apache-airflow-providers-amazon==8.16.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested apache-airflow-providers-amazon==8.16.0
    The user requested (constraint) apache-airflow-providers-amazon==8.16.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

requirements.txt内容

--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.8.1/constraints-3.11.txt"

apache-airflow-providers-amazon==8.16.0
apache-airflow-providers-postgres==5.10.0

#       https://seasensor.atlassian.net/browse/SP-4980
--find-links /usr/local/airflow/plugins --no-index

# TODO: Remove these dependencies when we've moved to remote operators. These
#       are all Task Code Requirements and not Airflow Requirements
# NOTE: Any requirement found both in https://github.com/iocurrents/data-pipeline/blob/main/scripts/requirements.txt
#       and in the constraints file automatically default to the constrains file
#       version.
botocore==1.34.67
iniconfig==2.0.0
jmespath==1.0.1
jsonschema==4.21.1
jsonschema-specifications==2023.12.1
markdown-it-py==3.0.0
mdurl==0.1.2
numpy==1.24.4  # Downgraded from 1.24.4
packaging==24.0
pandas==2.1.4 # Downgraded from 2.2.1
pluggy==1.3.0  # Downgrade from 1.4.0
psycopg2==2.9.9
pygments==2.17.2
pytest==7.4.4  # Downgraded from 8.1.1
python-dateutil==2.8.2  # Downgraded from 2.9.0.post0
pytz==2023.3.1.1  # Downgraded from 2024.1
referencing==0.32.1  # Downgraded from 0.34.0
rich==13.7.0  # Downgraded from 13.7.1
rpds-py==0.17.1 # Downgraded from 0.18.0
s3transfer==0.8.2 # Downgraded from 0.10.1
six==1.16.0
tzdata==2023.4 # Downgraded from 2024.1
urllib3==2.0.7 # Upgraded from 1.25.4

环境信息

python --version
Python 3.11.9
python -m pip --version
pip 24.0 from /Users/alexlordthorsen/.venvs/package_test/lib/python3.11/site-packages/pip (python 3.11)

移除版本固定仍无法解决问题

python -m pip download -r requirements/requirements.txt -d plugins
Looking in links: /usr/local/airflow/plugins
WARNING: Location '/usr/local/airflow/plugins' is ignored: it is either a non-existing path or lacks a specific scheme.
ERROR: Cannot install apache-airflow-providers-amazon because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested apache-airflow-providers-amazon
    The user requested (constraint) apache-airflow-providers-amazon==8.16.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/topics/dependency-resolution/#dealing-with-dependency-conflicts

补充说明

注释掉--find-links /usr/local/airflow/plugins --no-index这一行后,下载依赖的问题暂时解决,但目标系统将无法找到包含所有wheel包的压缩文件。


内容的提问来源于stack exchange,提问作者AlexLordThorsen

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.23 19:33:12