Installing Top2Vec on an M1/Silicon machine
2021/11/08 by Armin Pournaki

I ran into several compilation issues when trying to install Top2Vec on my M1/Silicon Mac. Here are a few steps that allowed me to install it without having to recur to Anaconda Python. Essentially, it comes down to manually installing the two error-prone dependencies llvmlite and scikit-learn.

First, install llvm and add it to the path (source):

brew install llvm@11
export PATH=$PATH:/opt/homebrew/opt/llvm@11/bin

Now, install llvmlite:

pip3 install llvmlite

Then, install scikit-learn (source):

pip3 install --no-cache --no-use-pep517 pythran cython pybind11 gast"==0.4.0"
pip3 install --pre -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy
pip3 install --no-use-pep517 scikit-learn"==1.0.0"

Now, you can install top2vec:

pip3 install top2vec