LoginSignup
6
6

More than 5 years have passed since last update.

Amazon Linux で Numpy, Scipy, scikit-learnを利用する

Posted at

背景

 * Numpy、Scipy 、scikit-learn を使う必要があった
 * インフラは AWS EC2 一択
 * ちょっとハマった

前提

  • Python は pyenv を使う build 済のバイナリなら、yum install で一発なんだけど。。。

ハマったこと

  • 公式ページで指定された依存ライブラリだけでは、エラーが出た
  • Amazon Linux では SRPM がリポジトリにないため、 yum-builddep が使えない

手順

ざっくり、必要そうなのは全部入るように groups install を使うことにしました

$ sudo yum groups install "Development tools" -y
$ sudo yum groups install "Development Libraries" -y
$ sudo yum install sqlite sqlite-devel  -y
$ sudo yum install lapack-devel blas-devel fftw-devel atlas-devel suitesparse-devel swig -y
$ pyenv local 2.7.8
$ pip install numpy scipy scikit-learn

fftw-devel とかが必要なのを見極めるのに結構時間を要した。

おまけ

pip で強制再インストールを行うには、下記のコマンドを使う

$ pip install --upgrade --force-reinstall numpy scipy scikit-learn
6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6