LoginSignup
8
8

More than 5 years have passed since last update.

Pythonで数値計算を始める(with Homebrew and pip)

Posted at

MacOSX 10.8.5(Mountain Lion)
上にPythonで数値計算ができる環境を構築します.

今回はHomebrewとpipを使ってやってみます.
Homebrewはversion 0.9.5です.

まず以下のコマンドでいろいろインストール.

$ brew install python
$ sudo easy_install pip
$ sudo pip install ipython
$ sudo pip install scipy
$ sudo pip install ipython

当環境ではpython 2.7.6,pip 1.5.4がインストールされました.

ScipyのインストールにFortranコンパイラが必要なのでgfortranをインストールします.

$ brew install gfortran
$ sudo pip install scipy

Scipyのインストールには結構時間がかかりました.

ここからはmatplotlibをインストールするための準備です.

$ brew install freetype

これがないとmatplotlibのインストールでコケます.
さらに以下のシンボリックリンク作成も必要でした.
こちらを参考にしました)

$ ln -s /usr/local/opt/freetype/include/freetype2 /usr/local/include/freetype

そしてmatplotlibをインストール

sudo pip install matplotlib

使うかわかりませんがpandasもインストールします

$ sudo pip install pandas

以下pip freezeで各バーションを確認した結果です.

ipython==1.2.1
matplotlib==1.3.1
numpy==1.6.1
pandas==0.13.1
scipy==0.13.3
8
8
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
8
8