繁体   English   中英

Python pip 安装pyarrow错误,无法执行'cmake'

[英]Python pip install pyarrow error, unable to execute 'cmake'

我正在尝试在我的 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 无关? 我会很感激任何帮助。

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

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

pip --version
> pip 18.1

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

On Linux, you will need pip >= 19.0 to detect the prebuilt binary packages.

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

pip install --upgrade pip

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

--no-use-pep517开关与 pip 一起使用对我有用。 (与 Debian 11、Python 3.11、pip 22.3.1)

根据我的理解,pip 尝试使用PEP-517并从源代码构建 pyarrow。

当我尝试时,最初这失败了 cmake。一旦我通过apt-get install cmake ,我又遇到了另一个关于 Arrow 没有被安装的错误。 然后我从一些 GitHub 问题中发现了关于--no-use-pep517的信息:

一些提及此解决方法的票证:

似乎 pyarrow 与 cmake 和 pip 存在问题。

您可以使用 conda 代替 pip。

conda install -c conda-forge pyarrow

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM