How to install pyarrow on M1 Mac Monterey

Viewed 2687

I'm wondering if you can lend some insight into how to install pyarrow onto an M1 inside a pyenv virtual env?

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

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

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.

1 Answers

I fixed by adding the following to my .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

Related