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