21

我正在尝试在我的 EMR 集群的主实例上安装 pyarrow,但是我总是收到此错误。

[hadoop@ip-XXX-XXX-XXX-XXX ~]$ sudo /usr/bin/pip-3.4 install pyarrow
Collecting pyarrow
Downloading https://files.pythonhosted.org/packages/c0/a0/f7e9dfd8988d94f4952f9b50eb04e14a80fbe39218520725aab53daab57c/pyarrow-0.10.0.tar.gz (2.1MB)
100% |████████████████████████████████| 2.2MB 643kB/s 
Requirement already satisfied: numpy>=1.10 in /usr/local/lib64/python3.4/site-packages (from pyarrow)
Requirement already satisfied: six>=1.0.0 in /usr/local/lib/python3.4/site-packages (from pyarrow)
Installing collected packages: pyarrow
Running setup.py install for pyarrow ... error
Complete output from command /usr/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/mnt/tmp/pip-build-pr3y5_mu/pyarrow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-vmywdpeg-record/install-record.txt --single-version-externally-managed --compile:
/usr/lib64/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
/mnt/tmp/pip-build-pr3y5_mu/pyarrow/.eggs/setuptools_scm-3.1.0-py3.4.egg/setuptools_scm/utils.py:118: UserWarning: 'git' was not found
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.4
creating build/lib.linux-x86_64-3.4/pyarrow
copying pyarrow/pandas_compat.py -> build/lib.linux-x86_64-3.4/pyarrow
copying pyarrow/serialization.py -> build/lib.linux-x86_64-3.4/pyarrow
......
creating build/lib.linux-x86_64-3.4/pyarrow/tests/data
copying pyarrow/tests/data/v0.7.1.all-named-index.parquet -> build/lib.linux-x86_64-3.4/pyarrow/tests/data
copying pyarrow/tests/data/v0.7.1.column-metadata-handling.parquet -> build/lib.linux-x86_64-3.4/pyarrow/tests/data
copying pyarrow/tests/data/v0.7.1.parquet -> build/lib.linux-x86_64-3.4/pyarrow/tests/data
copying pyarrow/tests/data/v0.7.1.some-named-index.parquet -> build/lib.linux-x86_64-3.4/pyarrow/tests/data
running build_ext
creating build/temp.linux-x86_64-3.4
-- Runnning cmake for pyarrow
cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.4  -DPYARROW_BOOST_USE_SHARED=on -DCMAKE_BUILD_TYPE=release /mnt/tmp/pip-build-pr3y5_mu/pyarrow
unable to execute 'cmake': No such file or directory
error: command 'cmake' failed with exit status 1

----------------------------------------
Command "/usr/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/mnt/tmp/pip-build-pr3y5_mu/pyarrow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-vmywdpeg-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /mnt/tmp/pip-build-pr3y5_mu/pyarrow/

我不知道为什么它说'command'cmake' failed with exit status 1',事实上可以肯定的是,我预先安装了cmake,但我仍然得到这个错误。此外,我可以毫无问题地执行 sudo pip install pyarrow,但是在使用 sudo pip-3.4 install pyarrow 时出现错误。我是否遗漏了什么或者这个错误与cmake无关?我会很感激任何帮助。

4

3 回答 3

18

对我来说(在 linux 上),问题是 pip 版本太旧

pip --version
> pip 18.1

这是根据arrow.apache.org太低:

在 Linux 上,您需要 pip >= 19.0 来检测预构建的二进制包。

升级pip到最新版本,这对我有用:

pip install --upgrade pip

但对您来说可能会有所不同,请参阅此线程以了解其他升级方式pip

于 2021-07-21T09:41:59.450 回答
16

最后,我找到了一种通过安装早期版本的 pyarrow 来解决这种情况的方法。我试图安装失败的 pyarrow-0.10.0。但是如果我安装的是 pyarrow-0.9.0,它就可以工作。所以我认为cmake和pyarrow-0.10.0之间可能存在一些兼容问题。

于 2018-09-11T11:50:37.080 回答
-4

Seems there is problem with pyarrow with cmake and pip.

You can use conda instead of pip.

conda install -c conda-forge pyarrow

于 2020-10-17T16:13:24.963 回答