1

I'm on MacOS Monterey 12.5, m1 chip Using Python 3.7.13 in a virtualenv created as follows:

pyenv install 3.7.13
pyenv virtualenv 3.7.13 qtrainer
pyenv activate qtrainer

OpenSSL version is 1.1.1q

apache-arrow version is 9.0.0

my .zshrc file contains :

export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"
export OPENSSL_ROOT_DIR="/opt/homebrew/opt/openssl@1.1"

I run pip install pyarrow with no issue

But then

$ python
Python 3.7.13 (default, Aug 20 2022, 12:38:41) 
[Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyarrow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "~/.pyenv/versions/3.7.13/envs/qtrainer/lib/python3.7/site-packages/pyarrow/__init__.py", line 65, in <module>
    import pyarrow.lib as _lib
ImportError: dlopen(~/.pyenv/versions/3.7.13/envs/qtrainer/lib/python3.7/site-packages/pyarrow/lib.cpython-37m-darwin.so, 0x0002): symbol not found in flat namespace (__Py_FatalErrorFunc)

I've tried everything I found on here, installing openssl1.0, uninstalling and reinstalling pyarrow with plenty of pip args, I always end up with the same error.

I've read that it means some packages have not been compiled witht he same compiler, bu I do not know which one needs to be reinstalled

I've tried changing python 3.7 to python 3.9, and can now import pyarrow but not pyarrow.parquet :

>>> import pyarrow.parquet
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "~/.pyenv/versions/3.9.6/envs/qtrainer3.9/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 34, in <module>
import pyarrow._parquet as _parquet

ModuleNotFoundError: No module named 'pyarrow._parquet'

I added -stdlib=libc++ to CFLAGS environment variable, then reinstalled pyarrow and it runs for python 3.9

0x26res
  • 11,925
  • 11
  • 54
  • 108
Borbag
  • 597
  • 4
  • 21
  • 1
    You seem to be using pyenv, can you show all the steps you're using to create your environment and installing `pyarrow`? Do you get any output when installing that looks weird? – wkl Aug 22 '22 at 17:22
  • Hello wkl, thanks for your comment. I added the informations to the post – Borbag Aug 22 '22 at 17:31
  • Do you know which wheel pip used to install pyarrow? It should be writen in `~/.pyenv/versions/3.7.13/envs/qtrainer/lib/python3.7/site-packages/pyarrow-9.0.0.dist-info/WHEEL` – 0x26res Aug 23 '22 at 11:33
  • Wheel-Version: 1.0 Generator: bdist_wheel (0.37.1) Root-Is-Purelib: false Tag: cp37-cp37m-macosx_12_0_arm64 – Borbag Aug 24 '22 at 07:49

0 Answers0