Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python pip install pyarrow error, unable to execute 'cmake'

I'm trying to install the pyarrow on a master instance of my EMR cluster, however I'm always receiving this error.

[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/

I don't know why it says 'command 'cmake' failed with exit status 1', In fact to be sure, I preinstalled the cmake, but I still get this error. Furthermore, I can do sudo pip install pyarrow with no problem, but I'm getting error when using sudo pip-3.4 install pyarrow. Am I missing something or maybe this error has nothing to do with cmake? I'll appreciate for any help.

like image 931
Yiming Wu Avatar asked Sep 05 '18 09:09

Yiming Wu


People also ask

What is Pyarrow in Python?

This is the documentation of the Python API of Apache Arrow. Apache Arrow is a development platform for in-memory analytics. It contains a set of technologies that enable big data systems to store, process and move data fast.

How do I get PIP in Python?

Ensure you can run pip from the command lineRun python get-pip.py . 2 This will install or upgrade pip. Additionally, it will install setuptools and wheel if they're not installed already. Be cautious if you're using a Python install that's managed by your operating system or another package manager.

How to fix Pip not working after installing Python?

Make sure to try using pip3 if needed. If all else fails, this has been a reliable way to get pip working on your python install. I would like to preface this with the fact that this shouldn’t be used consistently and I personally recommend simply reinstalling python after uninstalling all the current installations.

How do I upgrade pip install pyarrow?

Try to upgrade it with pip install --upgrade pip and run the command python3 -m pip install pyarrow again.

Can I use Conda instead of Pip in CMake?

Seems there is problem with pyarrow with cmake and pip. You can use conda instead of pip. Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question.

What are the system requirements for pyarrow?

PyArrow is regularly built and tested on Windows, macOS and various Linux distributions (including Ubuntu 16.04, Ubuntu 18.04). We strongly recommend using a 64-bit system. PyArrow is currently compatible with Python 3.7, 3.8, 3.9 and 3.10. Install the latest version of PyArrow from conda-forge using Conda:


2 Answers

For me (on linux) the problem was a too old version of pip

pip --version
> pip 18.1

which is according to arrow.apache.org too low:

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

to upgrade pip to the latest version, this worked for me:

pip install --upgrade pip

but it might be different for you, see this thread for other ways to upgrade pip.

like image 157
Anton Avatar answered Oct 24 '22 19:10

Anton


Finally I found a way to get around this situation by installing an earlier version of pyarrow. I was trying to install pyarrow-0.10.0 which failed. But if I'm installing the pyarrow-0.9.0, it works. So I think there might be some compatible issues between cmake and pyarrow-0.10.0.

like image 34
Yiming Wu Avatar answered Oct 24 '22 17:10

Yiming Wu