mattiajoy
mattiajoy

Reputation: 11

Failed to install Pytorch Snippets and Librosa in VScode - Apple M1

I anticipate I'm not an expert in informatics. I used to run PyTorch snippets for some deep learning on my old MacBook Pro (2015), but now I have Apple's last Pro, and have troubles with installing packages in VScode. Two of these packages give me trouble: PyTorch snippets and Librosa. PyTorch Snippets can be installed from the "extensions" in the VScode menu; that is what I did, and used to do with my old Mac. This time, however, when I import torch within an .ipynb instance I get the error "No module named 'torch'".

With Librosa, when I run in the terminal pip3 install librosa at some point I get this error:

Using cached idna-3.3-py3-none-any.whl (61 kB) Building wheels for collected packages: numba, llvmlite Building wheel for numba (setup.py) ... error

, then a long list of red things, then again:

ERROR: Failed building wheel for llvmlite Running setup.py clean for llvmlite Failed to build numba llvmlite Installing collected packages: llvmlite, idna, charset-normalizer, certifi, threadpoolctl, scipy, requests, numba, joblib, appdirs, soundfile, scikit-learn, resampy, pooch, audioread, librosa Running setup.py install for llvmlite ... error ERROR: Command errored out with exit status 1:

Do you experienced anything similar? Do you have some hint? Thanks a lot

Upvotes: 1

Views: 743

Answers (1)

Jon Nordby
Jon Nordby

Reputation: 6259

There is a fix described in https://github.com/numba/llvmlite/issues/693#issuecomment-909501195

arch -arm64 brew install llvm@11
LLVM_CONFIG="/opt/homebrew/Cellar/llvm@11/11.1.0_2/bin/llvm-config" arch -arm64 pip install llvmlite

Upvotes: 1

Related Questions