Windows で Python(x,y) 2.7.10 と各種パッケージのインストール
Windows での,Python(x,y) 2.7.10 と各種パッケージのインストール手順を説明する.
Python(x,y) は次のソフトウェアを一体化したもの (Python(x,y) is a collection of following softwares).
- Python
- Python の各種パッケージ (Python packages)
- ipython
- Spyder
- Microsoft Visual Studio 2008 for Python
- SWIG など (etc.)
このページでは、Python(x,y)と、Python の各種パッケージのインストールを行う. (In this Web page, we install Python(x,y), several Python packages.)
目次 (Index)
- Python(x,y) のダウンロードとインストール (Download and Install Python(x,y)
- Python のビルドに用いられたコンパイラの確認 (Examine the compilers that were used to build python on Windows)
- Python パッケージのインストール (Install / Upgrade Recommended Python Packages)
Python(x,y) のダウンロードとインストール (Download and Install Python(x,y))
- Python(x,y) の Web ページを開く (Open the Python(x,y) Web page)
- 「Download Python-xy」をクリック (click "Download Python-xy")
- ダウンロードサイトを選ぶ (select download site)
- ダウンロードの開始 (start download)
ダウンロードが終わるまで,しばらく待つ.
- ダウンロードしたインストーラを起動 (launch the installer)
- ライセンス条項の確認 (license agreement)
ライセンス条項に同意できる場合のみ次に進む
- ユーザの選択 (choose user)
- コンポーネントの選択 (choose components)
Python と Others にチェックする (Check Python and Others)
- インストールディレクトリ (Install Directory)
分かりやすいディレクトリにインストールしたほうが良いので,C:\pythonxy に変える (Set "C:\pythonxy")
- インストール開始 (Start Install)
インストール終了までしばらく待つ.
- インストール終了 (Install Completed)
- pip と setuptools の更新
Windows では,コマンドプロンプトを管理者として実行し, 次のコマンドを実行する.
python -m pip install -U pip setuptools
- 試しに Python を起動してみる (Try to launch Python)
python 1 + 2 exit()
- 確認 (Examine)
- Python2.7 ディレクトリ (Python 2.7 directory)
- Pythonxy ディレクトリ (Pythonxy directory)
- easy_install と pip も同時にインストールされる (easy_install and pip are also installed)
- Python のパッケージも同時にインストールされる (many Python packages are also installed)
pip list
- Python2.7 ディレクトリ (Python 2.7 directory)
- 確認のため spyder を起動してみる (Try to launch spyder)
- 確認のため "ipython qtconsole" を実行してみる (Try to do "ipython qtconsole")
新しい画面が開く
- 環境変数 PATH の確認
念のため、python, python\scripts, python\lib\site-packages にパスが通っているかの確認を行なっておく
echo %PATH%
Python のビルドに用いられたコンパイラの確認 (Examine the compilers that were used to build python on Windows)
-
Python を起動し、Python のビルドに用いられたコンパイラのバージョン番号を確認
(The version number of the compiler that is used to build the Python system)
python
下の実行例では、バージョン番号として「1500」が表示されている (In the following example, the version number is 1500).
- Python の distuitls パッケージに設定されているバージョン番号を確認
(Display the compiler version number that is set in the distutils package)
from distutils.msvc9compiler import * get_build_version()
先ほど表示されたバージョン番号(1500)と一致することを確認しておく. (The result of this step is equal to the compiler version number in the previous step?)
- Visual Studio 2008: VS9, MSC_VER=1500
- Visual Studio 2010: VS10, MSC_VER=1600
- Visual Studio 2012: VS11, MSC_VER=1700
- Visual Studio 2013: VS12, MSC_VER=1800
Python パッケージのインストール (Install / Upgrade Recommended Python Packages)
インストールしておきたいおすすめパッケージ.
コマンドプロンプトを開き,次のコマンドを実行 (Open Cmd.exe, and do the following command)
for %i in (setuptools sphinx numpy bottleneck scipy matplotlib ipython pygments pandas theano pillow ggplot prettyplotlib pygraphviz seaborn gloo statsmodels qgis orange scikit-image scikit-learn scikit-video scikits.statsmodels scikits.datasmooth scikits.example scikits.fitting scikits.learn scikits.optimization scikits.pulsefit scikits.timeseries scikits.vectorplot bottle numexpr xlrd xlsxwriter zodb lxml beautifulsoup gdata) do python -m pip install -U %i
pip の実行時に次のようなエラーがでる場合がある.
error: Unable to find vcvarsall.bat
このエラーが出たときは、setuptools の更新を行う
python -m pip install -U setuptools