1.安装Python 2.7.3Python 2.7.3のインストール
cd src
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar zxvf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/usr/local
make
# altinstallを使ってCentOSに標準で入っているpython 2.6.6と別にインストールするようにします。
sudo make altinstall
# 確認
which python2.7
# /usr/local/bin/python2.7
2.安装distributedistributeのインストール
cd src
wget http://pypi.python.org/packages/source/d/distribute/distribute-0.6.27.tar.gz
tar zxvf distribute-0.6.27.tar.gz
cd distribute-0.6.27
sudo python2.7 setup.py install 现在开始,可以使用easy_install-2.7命令了。
これでeasy_install-2.7コマンドが使用可能になりました。
3.安装pippipのインストール
sudo easy_install-2.7 pip
4. 安装PIL(Python Imaging Library)
PIL(Python Imaging Library)のインストール
sudo pip install pil
5.安装numpynumpyのインストール
为了安装numpy、scipy,首先要安装gfortran、blas、lapack
numpy、scipyをインストールするために先ずgfortran、blas、lapackをインストールします。
5.1安装gfortrangfortranのインストール
sudo yum install gcc-gfortran
5.2安装blasblasのインストール
sudo yum install blas-devel
5.3安装lapacklapackのインストール
sudo yum install lapack-devel
5.4安装numpynumpyのインストール
cd ~/src
wget http://downloads.sourceforge.net/project/numpy/NumPy/1.6.2/numpy-1.6.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fnumpy%2Ffiles%2FNumPy%2F1.6.2%2F&ts=1351388100&use_mirror=jaist
tar zxvf numpy-1.6.2.tar.gz
cd numpy-1.6.2
python2.7 setup.py build
sudo python2.7 setup.py install
6安装scipyscipyのインストール
cd ~/src
wget http://downloads.sourceforge.net/project/scipy/scipy/0.11.0/scipy-0.11.0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fscipy%2Ffiles%2Fscipy%2F0.11.0%2F&ts=1351388172&use_mirror=jaist
tar zxvf scipy-0.11.0.tar.gz
cd scipy-0.11.0
python2.7 setup.py build
sudo python2.7 setup.py install
7.安装matplotlibmatplotlibのインストール
必须要装了png.h后,才能安装matplotlib
matplotlibのインストールにはpng.hが必要になるので、予め入れておきます。 sudo yum install libpng-devel 然后,就可以安装matplotlib了。
続いてmatplotlib本体をインストールします。 cd ~/src
wget http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.1.1/matplotlib-1.1.1.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmatplotlib%2Ffiles%2Fmatplotlib%2Fmatplotlib-1.1.1%2F&ts=1351382082&use_mirror=jaist
tar zxvf matplotlib-1.1.1.tar.gz
cd matplotlib-1.1.1
pytyon2.7 setup.py build
sudo python2.7 setup.py install
这样,python 2.7.3的环境就配置完成了。
これでpython 2.7.3の環境をひと通りつくることができました。