Skip to content

Instantly share code, notes, and snippets.

@bilzard
Created May 8, 2022 10:15
Show Gist options
  • Save bilzard/e8808aa0df24355765763620d8d092b3 to your computer and use it in GitHub Desktop.
Save bilzard/e8808aa0df24355765763620d8d092b3 to your computer and use it in GitHub Desktop.
Install scikit-learn for M1 Mac

公式ドキュメントには miniforge でインストールするように案内されている。

https://scikit-learn.org/stable/install.html#installing-on-apple-silicon-m1-hardware

しかし、StackOverflowで紹介されている以下の方法でもインストールすることができた。

$ brew install openblas
$ export OPENBLAS=$(/opt/homebrew/bin/brew --prefix openblas)
$ export CFLAGS="-falign-functions=8 ${CFLAGS}"
$ # ^ no need to add to .zshrc, just doing this once.
$ pip install scikit-learn # ==0.24.1 if you want

https://stackoverflow.com/questions/68620927/installing-scipy-and-scikit-learn-on-apple-m1

@bilzard
Copy link
Author

bilzard commented May 8, 2022

miniforgeでインストールできるものは全てこちらからインストールする方が良さそう。

  • transformers
  • pandas
  • ipython

@bilzard
Copy link
Author

bilzard commented May 8, 2022

逆にtorchaudioのインストールはpipじゃないとうまくいかなかった。

pip install torch torchaudio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment