安装apache-airflow 1.10.5 wheel包出错,求解决方案
安装Apache Airflow 1.10.5时的依赖解析错误解决思路
我在Python 3.8.12的pyenv环境下,安装包含apache-airflow==1.10.5的requirements.txt时遇到错误。已经尝试过升级setuptools、安装并升级apispec、升级pip(受限于pyenv绑定版本),求下一步解决方法。
错误日志
pip3 install "apache-airflow==1.10.5" Collecting apache-airflow==1.10.5 Using cached apache_airflow-1.10.5-py2.py3-none-any.whl (5.9 MB) Collecting alembic<2.0,>=1.0 (from apache-airflow==1.10.5) Using cached alembic-1.10.3-py3-none-any.whl (212 kB) Collecting cached-property~=1.5 (from apache-airflow==1.10.5) Using cached cached_property-1.5.2-py2.py3-none-any.whl (7.6 kB) Collecting colorlog==4.0.2 (from apache-airflow==1.10.5) Using cached colorlog-4.0.2-py2.py3-none-any.whl (17 kB) Collecting configparser<3.6.0,>=3.5.0 (from apache-airflow==1.10.5) Using cached configparser-3.5.3-py2.py3-none-any.whl (21 kB) Collecting croniter<0.4,>=0.3.17 (from apache-airflow==1.10.5) Using cached croniter-0.3.37-py2.py3-none-any.whl (13 kB) Collecting dill<0.3,>=0.2.2 (from apache-airflow==1.10.5) Using cached dill-0.2.9.tar.gz (150 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting dumb-init>=1.2.2 (from apache-airflow==1.10.5) Using cached dumb-init-1.2.5.post1.tar.gz (11 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting flask<2.0,>=1.1.0 (from apache-airflow==1.10.5) Using cached Flask-1.1.4-py2.py3-none-any.whl (94 kB) Collecting flask-appbuilder<2.0.0,>=1.12.5 (from apache-airflow==1.10.5) Using cached Flask-AppBuilder-1.13.1.tar.gz (1.5 MB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [4 lines of output] <string>:3: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses error in Flask-AppBuilder setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected end or semicolon (after version specifier) apispec[yaml]>=1.1.1<2 ~~~~~~~^ [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip.
解决步骤
锁定Flask-AppBuilder兼容版本:错误根源是Flask-AppBuilder 1.13.1的依赖写法
apispec[yaml]>=1.1.1<2不符合新版pip/setuptools的语法规范。手动安装修复了该问题的1.13.0版本,再安装Airflow:pip install "Flask-AppBuilder==1.13.0" "apache-airflow==1.10.5"回退setuptools版本:新版setuptools对依赖语法校验更严格,回退到兼容的旧版本(如45.x系列):
pip install setuptools==45.0.0 pip install "apache-airflow==1.10.5"启用旧版依赖解析器:让pip使用legacy-resolver模式,兼容不规范的依赖写法:
pip install "apache-airflow==1.10.5" --use-deprecated=legacy-resolver
内容的提问来源于stack exchange,提问作者jimhens
相关产品推荐
相关产品推荐

