我使用的是 MacOS Mojave、Python 3.8.3 和 pip 23.2。我创建了一个 py_env,激活它,然后运行
pip install apache-airflow==2.6.3' \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.6.3/constraints-3.8.txt".
一开始我遇到一个错误,说找不到文件“pybind11”。我通过运行 python -m pip install pybind11 安装了 pybind11,但现在出现了多个未知类型错误和其他错误。
python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [140 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-cpython-38
copying re2.py -> build/lib.macosx-10.9-x86_64-cpython-38
running build_ext
building '_re2' extension
creating build/temp.macosx-10.9-x86_64-cpython-38
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -
DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -
I/Users/chu/opt/anaconda3/include -arch x86_64 -
I/Users/chu/opt/anaconda3/include -arch x86_64 -
I/Users/chu/Desktop/Airflow_test/py_env/lib/python3.8/site-
packages/pybind11/include -
I/Users/chu/Desktop/Airflow_test/py_env/include -
I/Users/chu/opt/anaconda3/include/python3.8 -c _re2.cc -o
build/temp.macosx-10.9-x86_64-cpython-38/_re2.o -fvisibility=hidden
In file included from _re2.cc:11:
...
/Users/chu/Desktop/Airflow_test/py_env/lib/python3.8/site-
packages/pybind11/include/pybind11/detail/common.h:688:18: warning:
alias declarations are a C++11 extension [-Wc++11-extensions]
using type = ISeq;
^
fatal error: too many errors emitted, stopping now [-ferror-
limit=]
18 warnings and 20 errors generated.
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a
problem with pip.
ERROR: Failed building wheel for google-re2
Running setup.py clean for google-re2
Failed to build google-re2
ERROR: Could not build wheels for google-re2, which is required to
install pyproject.toml-based projects
答案1
我会从最底层的错误开始,然后从那里继续。
ERROR: Could not build wheels for google-re2, which is required to install pyproject.toml-based projects
看来 google-re2 是一个需要满足的约束。
从...开始pip install google-re2
https://pypi.org/project/google-re2/
您还可以前往https://raw.githubusercontent.com/apache/airflow/constraints-2.6.3/constraints-3.8.txt这是成功安装气流所需的软件包列表。
您可以将其与已安装的软件包列表进行比较。您可以通过运行pip list
或pip list -v
(详细 - 为您提供已安装软件包的位置)来执行此操作