【问题标题】:koalas pip install fails on pyarrow dependency考拉 pip 安装在 pyarrow 依赖项上失败
【发布时间】:2019-09-15 00:02:48
【问题描述】:

我尝试使用推荐的 pip install koalas 安装 Databricks 的新 koalas 软件包,但在 pyarrow 安装时失败。

然后我安装了pyarrow 并重试了koalas,但在pyarrow 上仍然失败。我访问了the Github page,它告诉我:

如果这无法安装 pyarrow 依赖项,您可能需要尝试 使用 Python 3.6.x 安装,因为 pip install 箭头不起作用 3.7 https://github.com/apache/arrow/issues/1125 的盒子。

我搜索了讨论,无法理解“解决方案”,也许是因为没有任何解决方案。我正在使用 Python 3.7.3。我得到的错误信息是:

  creating build/temp.macosx-10.7-x86_64-3.7
  -- Runnning cmake for pyarrow
  cmake -DPYTHON_EXECUTABLE=/anaconda3/bin/python  -DPYARROW_BOOST_USE_SHARED=on -DCMAKE_BUILD_TYPE=release /private/tmp/pip-install-uhdr9agf/pyarrow
  unable to execute 'cmake': No such file or directory
  error: command 'cmake' failed with exit status 1

  ----------------------------------------
  Failed building wheel for pyarrow
  Running setup.py clean for pyarrow
Failed to build pyarrow
Installing collected packages: pyarrow, koalas
  Found existing installation: pyarrow 0.13.0
    Uninstalling pyarrow-0.13.0:
      Successfully uninstalled pyarrow-0.13.0
  Running setup.py install for pyarrow ... error
    Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-uhdr9agf/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 /private/tmp/pip-record-i7k4nwil/install-record.txt --single-version-externally-managed --compile:

...

    -- Runnning cmake for pyarrow
    cmake -DPYTHON_EXECUTABLE=/anaconda3/bin/python  -DPYARROW_BOOST_USE_SHARED=on -DCMAKE_BUILD_TYPE=release /private/tmp/pip-install-uhdr9agf/pyarrow
    unable to execute 'cmake': No such file or directory
    error: command 'cmake' failed with exit status 1

    ----------------------------------------
  Rolling back uninstall of pyarrow

... 

Command "/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-uhdr9agf/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 /private/tmp/pip-record-i7k4nwil/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-install-uhdr9agf/pyarrow/

我已经尝试过pip install koalassudo pip install koalassudo -H pip install koalas,并且都有相同的错误消息。

有没有人找到解决这些错误的方法?还是考拉不(还)与 3.7 兼容?

【问题讨论】:

  • 即使我用 Python 3.7 尝试过,它也不起作用。它归结为箭头依赖性并且不会安装。虽然适用于 3.6

标签: python pandas pyspark databricks pyarrow


【解决方案1】:

您可能看到了这一点,但您提到的关于箭头的 github 帖子说“它确实适用于 Python”

我能够让考拉使用 python 3.6 在单机 spark 本地模式下工作,并成功运行 github 示例脚本......它还指定“推荐使用 pyspark>=2.4.0”

我相信如果你尝试 3.6,它会为你工作。

import sys
print(sys.version)
import pandas as pd
import databricks.koalas as ks
import pyarrow as pa

3.6.8

pdf = pd.DataFrame({'x':range(3), 'y':['a','b','b'], 'z':['a','b','b']})
print(pdf.head())

   x  y  z
0  0  a  a
1  1  b  b
2  2  b  b

df = ks.from_pandas(pdf)
df.columns = ['x', 'y', 'z1']
df['x2'] = df.x * df.x
df['x2']
0    0
1    1
2    4
Name: x2, dtype: int64

【讨论】:

  • 我做到了,并且在“3.7 版无法开箱即用...”链接中,他们建议了补救措施,但没有一个对我有用。
猜你喜欢
  • 2020-10-04
  • 2022-06-14
  • 2016-08-21
  • 1970-01-01
  • 2018-09-27
  • 2011-01-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多