LoginSignup
6
5

More than 5 years have passed since last update.

scipyはpython 2.7.8だとpip installでつまずく

Posted at

pyenv virtualenv@Mavericks環境下でpython 2.7.8を使っている際にpip install scipyでエラーが発生しインストールできない現象に遭遇.
python 2.7.5や3.4.1だと問題なくインストールできた.

原因

pip install scipyを実行すると普通はwheelがダウンロードされ,コンパイルされることなくインストールされる.
python 2.7.5や3.4.1などではwheelがダウンロードされるため何事もなくインストールされる.
しかし,python 2.7.8だとなぜかwheelではなくソースコードのtar.gzがダウンロードされ,コンパイルが始まってしまう.
その際にscipyのnumpy依存が適切に処理されず,エラーが起きる.scipyのバグ?

解決方法1

Python 2.7.8を使うのをあきらめ2.7.5を使う.
wheelを使ったインストールがされるため,依存関係のトラブルがおきない.
scipyを使ったモジュールのインストールでもトラブらなくなる.

解決方法2(未確認)

先にnumpyをインストールしてからscipyをインストールすることで依存関係はクリアできる.
しかし,scipyインストール時にFortran compilerが必要だと怒られる.
ここから先は,
https://gist.github.com/goldsmith/7262122
に手順がのっているが,自分は試していない.

6
5
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
5