python - 使用pip_pypy3安装pyarrow时出现 "Could NOT find Arrow"错误

标签 python cmake pypy pyarrow

我正在尝试使用pypy3来安装pyarrow,但是出现了一些错误。
基本信息吹:

macOS 10.15.7
Xcode 12.3
python version 3.7.9
pypy3 version 7.3.3 
pyarrow version 0.17.1
cmd is 'pip_pypy3 install pyarrow==0.17.1'
日志中的一些关键信息和错误内容:
...
Requirement already satisfied: numpy>=1.14 in /usr/local/Cellar/pypy3/7.3.3/libexec/site-packages (from pyarrow==0.17.1) (1.19.5)
...
cmake -DPYTHON_EXECUTABLE=/usr/local/Cellar/pypy3/7.3.3/bin/pypy3  -DPYARROW_BUILD_CUDA=off -DPYARROW_BUILD_FLIGHT=off -DPYARROW_BUILD_GANDIVA=off -DPYARROW_BUILD_DATASET=off -DPYARROW_BUILD_ORC=off -DPYARROW_BUILD_PARQUET=off -DPYARROW_BUILD_PLASMA=off -DPYARROW_BUILD_S3=off -DPYARROW_BUILD_HDFS=off -DPYARROW_USE_TENSORFLOW=off -DPYARROW_BUNDLE_ARROW_CPP=off -DPYARROW_BUNDLE_BOOST=off -DPYARROW_GENERATE_COVERAGE=off -DPYARROW_BOOST_USE_SHARED=on -DPYARROW_PARQUET_USE_SHARED=on -DCMAKE_BUILD_TYPE=release /private/var/folders/7p/d9yrtx8s2h94h9bh3x801zmr0000gn/T/pip-install-jagh2frg/pyarrow_522bc325fbd74d9ebdf84f29e3a66c0c
...
2021-01-10T21:19:27,670   -- Found Python3: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 (found version "3.7.9") found components: Interpreter Development NumPy Development.Module Development.Embed
2021-01-10T21:19:27,713   -- Found Python3Alt: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7
2021-01-10T21:19:28,226   CMake Warning (dev) at /usr/local/Cellar/cmake/3.19.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
2021-01-10T21:19:28,227     The package name passed to `find_package_handle_standard_args` (PkgConfig)
2021-01-10T21:19:28,227     does not match the name of the calling package (Arrow).  This can lead to
2021-01-10T21:19:28,227     problems in calling code that expects `find_package` result variables
2021-01-10T21:19:28,227     (e.g., `_FOUND`) to follow a certain pattern.
2021-01-10T21:19:28,227   Call Stack (most recent call first):
2021-01-10T21:19:28,227     /usr/local/Cellar/cmake/3.19.2/share/cmake/Modules/FindPkgConfig.cmake:67 (find_package_handle_standard_args)
2021-01-10T21:19:28,228     cmake_modules/FindArrow.cmake:39 (include)
2021-01-10T21:19:28,228     cmake_modules/FindArrowPython.cmake:46 (find_package)
2021-01-10T21:19:28,228     CMakeLists.txt:210 (find_package)
2021-01-10T21:19:28,228   This warning is for project developers.  Use -Wno-dev to suppress it.

2021-01-10T21:19:28,229   -- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
2021-01-10T21:19:28,255   -- Could NOT find Arrow (missing: Arrow_DIR)
2021-01-10T21:19:28,255   -- Checking for module 'arrow'
2021-01-10T21:19:28,269   --   No package 'arrow' found
2021-01-10T21:19:28,270   CMake Error at /usr/local/Cellar/cmake/3.19.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
2021-01-10T21:19:28,270     **Could NOT find Arrow (missing: ARROW_INCLUDE_DIR ARROW_LIB_DIR**
2021-01-10T21:19:28,270     **ARROW_FULL_SO_VERSION ARROW_SO_VERSION)**
2021-01-10T21:19:28,271   Call Stack (most recent call first):
2021-01-10T21:19:28,271     /usr/local/Cellar/cmake/3.19.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:582 (_FPHSA_FAILURE_MESSAGE)
2021-01-10T21:19:28,271     cmake_modules/FindArrow.cmake:412 (find_package_handle_standard_args)
2021-01-10T21:19:28,271     cmake_modules/FindArrowPython.cmake:46 (find_package)
2021-01-10T21:19:28,271     CMakeLists.txt:210 (find_package)
2021-01-10T21:19:28,272   -- Configuring incomplete, errors occurred!
我是否需要添加一些环境变量(例如 ARROW_INCLUDE_DIR )才能完成安装?

根据 Uwe L. Korn 所说,我已经使用 brew install brew install apache-arrow 安装了 arrow c++。和 brew install apache-arrow-glib ,但还有一个问题。
2021-01-11T17:44:05,139   creating build/bdist.macosx-10.7-x86_64/wheel/pyarrow/include
2021-01-11T17:44:05,140   error: can't copy 'build/lib.macosx-10.7-x86_64-3.7/pyarrow/include/arrow': doesn't exist or not a regular file
2021-01-11T17:44:05,149   ERROR: Failed building wheel for pyarrow
2021-01-11T17:44:05,151 Failed to build pyarrow
2021-01-11T17:44:05,152 ERROR: Could not build wheels for pyarrow which use PEP 517 and cannot be installed directly
2021-01-11T17:44:05,152 Exception information:
2021-01-11T17:44:05,152 Traceback (most recent call last):
2021-01-11T17:44:05,152   File "/usr/local/Cellar/pypy3/7.3.3/libexec/site-packages/pip-20.3.3-py3.7.egg/pip/_internal/cli/base_command.py", line 224, in _main
2021-01-11T17:44:05,152     status = self.run(options, args)
2021-01-11T17:44:05,152   File "/usr/local/Cellar/pypy3/7.3.3/libexec/site-packages/pip-20.3.3-py3.7.egg/pip/_internal/cli/req_command.py", line 180, in wrapper
2021-01-11T17:44:05,152     return func(self, options, args)
2021-01-11T17:44:05,152   File "/usr/local/Cellar/pypy3/7.3.3/libexec/site-packages/pip-20.3.3-py3.7.egg/pip/_internal/commands/install.py", line 364, in run
2021-01-11T17:44:05,152     ", ".join(pep517_build_failure_names)
2021-01-11T17:44:05,152 pip._internal.exceptions.InstallationError: Could not build wheels for pyarrow which use PEP 517 and cannot be installed directly
2021-01-11T17:44:05,200 Removed build tracker: '/private/var/folders/7p/d9yrtx8s2h94h9bh3x801zmr0000gn/T/pip-req-tracker-lp8m3f4g'

最佳答案

编译问题的答案是您应该首先安装 Arrow C++。虽然这只会让你更进一步,接下来你会遇到一个新的障碍,如 pyarrow目前不使用 PyPy,只使用 CPython。有一个开放的上游问题 ARROW-2651您可以在其中跟踪进度,但目前似乎没有人在做这件事。因此,在您的情况下,您可以坚持使用 CPython 或帮助解决该问题以修复丢失的位以使其在 PyPy 上运行。

关于python - 使用pip_pypy3安装pyarrow时出现 "Could NOT find Arrow"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65653927/

相关文章:

仅当从已安装的包调用时,Python 从子文件夹导入才会失败

python - 机器学习电子邮件优先级 - Python

python - Tkinter 小部件布局错误?

cmake - 编译具有相同目标的不同子项目时出现 CMP0002 错误

c++ - 带柯南的 Cmakelists

python - PyPy 和高效数组

python - 优化 python/pypy 中的蛮力过程以查找独生子女号码

python - 将 Sympy 与 Pypy 结合使用

python - 如何在应用程序外部访问 Flask 应用程序配置?

c++ - CMake 无法识别混合 C++/FORTRAN 程序中的 FORTRAN 源代码