事前準備
インストールしたときの状況を覚えていないもの
- Python
- 最初から入っているやつではなく、公式サイトからダウンロードしたもの
- SciPyとかのサイトに入れ直した方がいいみたいなことが書いてあった
- ダウンロードはここから
- gccとか
- XcodeをApp Storeからインストールしておく
- gccとかいろいろ開発関連のものがインストールされるはず
- fortran
- SciPy関連で必要らしい
- SciPyのサイトで紹介されてた「http://r.research.att.com/gfortran-lion-5666-3.pkg」をダウンロードしてインストールした
- その他
- 必要なものが他にもあるかもしれない・・・
export
- $ export CC=gcc-4.2
- $ export CXX=g++-4.2
- $ export FFLAGS=-ff2c
NumPy
- $ git clone https://github.com/numpy/numpy.git
- $ cd numpy
- $ python setup.py build
- $ sudo python setup.py install
- $ git clone https://github.com/scipy/scipy.git
- $ cd scipy
- $ python setup.py build
- $ sudo python setup.py install
- $ git clone https://github.com/matplotlib/matplotlib.git
- $ cd matplotlib
- $ python setup.py build
- $ sudo python setup.py install
テスト
このページの使用例より
>>> from pylab import *
>>> x = range(10)
>>> y = [y1**2 for y1 in x]
>>> plot(x, y, 'ro')
[<matplotlib.lines.Line2D object at 0x104118590>]
>>> savefig('test.png')
>>> show()
参考URL
このページの使用例より
>>> from pylab import *
>>> x = range(10)
>>> y = [y1**2 for y1 in x]
>>> plot(x, y, 'ro')
[<matplotlib.lines.Line2D object at 0x104118590>]
>>> savefig('test.png')
>>> show()
参考URL
0 件のコメント:
コメントを投稿