Install python via pyenv with bzip2 support:
xcode-select --install
brew install bzip2
export LDFLAGS="-L/usr/local/opt/bzip2/lib -L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/bzip2/include -I/usr/local/opt/zlib/include"
pyenv install -f 3.8.6
Install numpy and pandas:
brew install openblas
OPENBLAS="$(brew --prefix openblas)" pip install --force-reinstall --no-cache-dir numpy pandas
Otherwise you could get the error:
>>> import numpy
python(20307,0x10d16ee00) malloc: can't allocate region
:*** mach_vm_map(size=18446744072049074176, flags: 100) failed (error code=3)
python(20307,0x10d16ee00) malloc: *** set a breakpoint in malloc_error_break to debug
init_dgelsd failed init
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/alexandre/Developer/Etalab/catalogue/notebook/pyenv/lib/python3.8/site-packages/numpy/__init__.py", line 286, in <module>
raise RuntimeError(msg)
RuntimeError: Polyfit sanity test emitted a warning, most likely due to using a buggy Accelerate backend. If you compiled yourself, see site.cfg.example for information. Otherwise report this to the vendor that provided NumPy.
RankWarning: Polyfit may be poorly conditioned
Ref: numpy/numpy#17784 (comment)
brew install openssl
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
pip install cryptography