TutteInstitute / vectorizers

Vectorizers for a range of different data types
BSD 3-Clause "New" or "Revised" License
93 stars 23 forks source link

Needed to downgrade `numpy` and reinstall `libllvmlite` & `numba` #84

Open BBischof opened 2 years ago

BBischof commented 2 years ago

I tried installing vectorizers on a fresh pyenv and I got this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "vectorizers-master/vectorizers/__init__.py", line 1, in <module>
    from .token_cooccurrence_vectorizer import TokenCooccurrenceVectorizer
  File "vectorizers/token_cooccurrence_vectorizer.py", line 1, in <module>
    from .ngram_vectorizer import ngrams_of
  File "vectorizers/ngram_vectorizer.py", line 2, in <module>
    import numba
  File "numba-0.54.1-py3.9-macosx-11.3-x86_64.egg/numba/__init__.py", line 19, in <module>
    from numba.core import config
  File "numba-0.54.1-py3.9-macosx-11.3-x86_64.egg/numba/core/config.py", line 16, in <module>
    import llvmlite.binding as ll
  File "llvmlite-0.37.0-py3.9.egg/llvmlite/binding/__init__.py", line 4, in <module>
    from .dylib import *
  File "llvmlite-0.37.0-py3.9.egg/llvmlite/binding/dylib.py", line 3, in <module>
    from llvmlite.binding import ffi
  File "llvmlite-0.37.0-py3.9.egg/llvmlite/binding/ffi.py", line 191, in <module>
    raise OSError("Could not load shared object file: {}".format(_lib_name))
OSError: Could not load shared object file: libllvmlite.dylib

This was resolvable for me by uninstalling and reinstalling libllvmlite & numba after ensuring numpy<1.21, e.g.

pip install numpy==1.20
pip uninstall libllvmlite
pip uninstall numba
pip install libllvmlite
pip install numba

This is obviously not a big deal, but in case others bump this, maybe a ref in the README can save them a google. 🤷

lmcinnes commented 2 years ago

Thanks. There seem to be some issues in general with numpy 1.21 and numba not quite playing together nicely. It seems to have been largely confined to Mac's as far as I know. Do you have an M1 Mac by any chance?

Regardless, thanks for the report and documenting a fix.

BBischof commented 2 years ago

Nah still on intel but yes on Mac hardware.