Skip to content

Instantly share code, notes, and snippets.

@abulte
Last active February 8, 2021 18:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abulte/d6f1319afb4e337f05da68724856535a to your computer and use it in GitHub Desktop.
Save abulte/d6f1319afb4e337f05da68724856535a to your computer and use it in GitHub Desktop.
Big Sur python mayhem

pyenv

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

numpy, pandas

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)

cryptography

brew install openssl
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
pip install cryptography
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment