简体   繁体   English

如何在 M1 Mac Monterey 上安装 pyarrow

[英]How to install pyarrow on M1 Mac Monterey

I'm wondering if you can lend some insight into how to install pyarrow onto an M1 inside a pyenv virtual env?我想知道您是否可以深入了解如何将 pyarrow 安装到 pyenv 虚拟环境中的 M1 上?

I've done the following我做了以下

brew install pyenv
pyenv virtualenv 3.9.1 ve-pas
pyenv activate ve-pas
pip install pyarrow

And I get the following error output我收到以下错误 output

clang: build/src.macosx-12.0-arm64-3.9/numpy/core/src/multiarray/einsum.c
    clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly

 ----------------------------------------
    ERROR: Failed building wheel for numpy
  Failed to build numpy
  ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly

And when using pre-installed numpy with当使用预装的 numpy 时

pip install --no-use-pep517 --no-build-isolation pyarrow

CMake Error at /Users/josh/.pyenv/versions/3.9.1/envs/ve-pas-dev/lib/python3.9/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
      Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
      system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY
      OPENSSL_INCLUDE_DIR)

error output.错误 output。

I fixed by adding the following to my .zshrc我通过将以下内容添加到我的.zshrc来修复

#.zshrc
export OPENSSL_ROOT_DIR="/opt/homebrew/Cellar/openssl@3/3.0.1"

and re-running the second command并重新运行第二个命令

pip install --no-use-pep517 --no-build-isolation pyarrow

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

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