【问题标题】:"ERROR: Could not build wheels for pyarrow which use PEP 517 and cannot be installed directly" on armv7 architecture with Linux Debian Buster“错误:无法为使用 PEP 517 且无法直接安装的 pyarrow 构建轮子”在带有 Linux Debian Buster 的 armv7 架构上
【发布时间】:2021-11-16 14:34:28
【问题描述】:

我使用来自piwheels 的包为armv7 架构构建了一个带有python 包numpyscipypandasgoogle-cloud-bigquery 的Docker 映像。基础镜像是Python:3.7-buster

如果我使用此映像运行容器,容器总是会重新启动并给我错误日志“ValueError:此方法需要安装 pyarrow”:

Traceback (most recent call last):
  File "main_prog.py", line 3, in <module>
    upload_data()
  File "/usr/src/app/bigquery.py", line 39, in upload_data
    job = client.load_table_from_dataframe(dataframe, table_id, job_config=job_config)  # Make an API request.
  File "/usr/local/lib/python3.7/site-packages/google/cloud/bigquery/client.py", line 2574, in load_table_from_dataframe
    raise ValueError("This method requires pyarrow to be installed")
ValueError: This method requires pyarrow to be installed

所以我尝试直接在我的 Dockerfile 中安装pyarrow

RUN pip3 install pyarrow

这给了我错误“错误:无法为使用 PEP 517 且无法直接安装的 pyarrow 构建轮子”:

> [10/11] RUN pip3 install pyarrow:
#14 164.9   copying pyarrow/tests/parquet/test_parquet_writer.py -> build/lib.linux-armv7l-3.7/pyarrow/tests/parquet
#14 164.9   running build_ext
#14 164.9   creating /tmp/pip-install-jiim0m92/pyarrow_07d2ad5142d7405fa1b4bb2fe83e0428/build/temp.linux-armv7l-3.7
#14 164.9   -- Running cmake for pyarrow
#14 164.9   cmake -DPYTHON_EXECUTABLE=/usr/local/bin/python -DPython3_EXECUTABLE=/usr/local/bin/python  -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 /tmp/pip-install-jiim0m92/pyarrow_07d2ad5142d7405fa1b4bb2fe83e0428
#14 164.9   error: command 'cmake' failed with exit status 1
#14 164.9   ----------------------------------------
#14 164.9   ERROR: Failed building wheel for pyarrow
#14 164.9 Failed to build pyarrow
#14 164.9 ERROR: Could not build wheels for pyarrow which use PEP 517 and cannot be installed directly

然后喜欢它推荐的here我试过了:

RUN pip3 install pandas-gbq==0.14.0 

RUN pip install --upgrade 'google-cloud-bigquery[bqstorage,pandas]'

但没有任何效果,每次我遇到与上述相同的错误。 我在piwheelsPyPi 上都找不到armv7 的pyarrow 轮子。

有人知道答案吗?感谢您的帮助!

【问题讨论】:

  • 据我所知,pyarrow 没有为 arm7 发布轮子(它为 arm64 发布)。您可以尝试使用 conda 而不是 pip 安装(我也不确定它是否是受支持的版本)。如果这些都不起作用,您可能不得不尝试从源代码构建 pyarrow。
  • 是的,我已经尝试过了here。但这没有用,这就是为什么我用 pywheels 尝试它的原因。

标签: python-3.x google-bigquery dockerfile pyarrow armv7


【解决方案1】:

我通过使用带有 Node-RED

的单独容器映像解决了这个问题
FROM nodered/node-red:latest

RUN npm install node-red-contrib-google-cloud

我可以在上面使用 google-cloud 包。 这个容器现在处理上传到 google-cloud 的任务。 为了在 docker 中使用 node-red,我访问了 this sitethis 是我安装的 google-cloud-package。

【讨论】:

    猜你喜欢
    • 2020-11-09
    • 2020-11-01
    • 2021-04-14
    • 2020-08-05
    • 2021-02-28
    • 2020-10-16
    • 1970-01-01
    • 1970-01-01
    • 2021-03-07
    相关资源
    最近更新 更多