[PYTHON] Install Chainer 1.5.0 on Windows

Chainer has been dependent on Cython and h5py since 1.5.0 (see below for details and details).

pfnet/chainer v1.5.0 Unofficial tips for people who have trouble installing Chainer 1.5

For this reason, what was previously included in pip install chainer has become a bit of a hassle. Especially in the Windows environment, the damage is large, so I will explain the installation on Windows. The version of Python at the time of installation is 3.5 (Chainer already supports Python 3.5](https://github.com/pfnet/chainer/issues/526)!).

Visual Studio installation

Cython is a mechanism for generating and using actual C / C ++ code from Python with some notations such as C / C ++ types. This gives you both simple Python notation and C / C ++ execution speed.

Introduction to Cython for those who are not satisfied with NumPy

image

However, since these compilations are necessary for the convenience of executing C / C ++ code, it is necessary to install them at the time of installation (specifically, C generated from the part written in Cython in Chainer). (Required to compile / C ++ code).

The C / C ++ compiler on Windows comes with Visual Studio, so install it. For Python3.5, it will be Visual Studio 2015 (Community is OK, but you need to check VC ++ at the time of installation).

Visual Studio Download

There is a version of the compiler, and it is basically necessary to match this with the version of Visual Studio.

Using Microsoft Visual C with Python

Basically, the version of Visual C ++ is Python's MSC_VER minus 6. In the case of Python 3.5, the MSC version will be 19 as shown below, so the Visual C ++ version will be 14 because there is no 13 ..., that is, Visual Studio will be 2015 (probably one shift after that, so in the future I think you'll be subtracting 5 instead of 6).

>>> import sys
>>> sys.version
'3.5.0 |Continuum Analytics, Inc.| (default, Nov  7 2015, 13:25:22) [MSC v.1900
32 bit (Intel)]'

[Microsoft Visual C ++ / Product Version and Internal Version](https://ja.wikipedia.org/w/index.php?title=Microsoft_Visual_C%2B%2B&section=10#.E8.A3.BD.E5.93.81.E3 .83.90.E3.83.BC.E3.82.B8.E3.83.A7.E3.83.B3.E3.81.A8.E5.86.85.E9.83.A8.E3.83.90.E3.83 .BC.E3.82.B8.E3.83.A7.E3.83.B3)

However, I don't want to install old Visual Studio to install it (Python2 series is long ago ...), so it is possible to use the latest version of the settings by editing the registry. The vcvarsall used for compilation is obtained in distutils.msvc9compiler.find_vcvarsall, so it rewrites the following registry value referenced here.

I'm looking at the value of ProductDir in it (eg (eg C: \ Program Files \ Microsoft Visual Studio 14.0 \ VC )). If the above key and value do not exist, add a new key / value and set the VC ++ folder of Visual Studio that was actually installed.

Install Numpy, h5py

Thank you for your hard work. The rest is easy. Drop the dependent Numpy and h5py from the following and install them in the virtual environment (virtualenv). If you are using conda, you can also go through conda.

Unofficial Windows Binaries for Python Extension Packages

Install Chainer

The main dependent libraries are already installed, so you should be able to install them below.

pip install chainer

Thank you for your hard work!

Recommended Posts

Install Chainer 1.5.0 on Windows
Install Chainer 1.6 (GPU) on Windows 7.
[Python] [Chainer] [Windows] Install Chainer on Windows
Install pygraphviz on Windows 10
Install Chainer on CentOS 6.7
Install Numpy on virtualenv on Windows
Install watchdog on Windows + Python 3.3
Install Win-Kex (kali-linux) on Windows 10.
Prepare Chainer environment on Windows
Pip install --ugrade pip fails on Windows
Install OpenCV and Chainer on Ubuntu
Install CUDA 8.0 and Chainer on Ubuntu 16.04
Install python2.7 on windows 32bit environment
Install xgboost (python version) on Windows
Install Python on Windows + pip + virtualenv
Build and install OpenCV on Windows
Install Pytorch on Blender 2.90 python on Windows
How to install pycrypto on Windows
Install Python development environment on Windows 10
Install PyStan on Windows without Anaconda
How to install music 21 on windows
Install easy_install and pip on windows
Python on Windows
Install easy_install (Windows)
YOLO on Chainer
[Kivy] How to install Kivy on Windows [Python]
Install wsl2 and master linux on windows
How to install richzhang / colorization on Windows 10
Install mecab on Marvericks
Install Tensorflow on Mac
Install TensorFlow on Ubuntu
Install python on WSL
Install Faiss on CentOS 7
Install pyenv on mac
Install and run Python3.5 + NumPy + SciPy on Windows 10
Install Python3, numpy, pandas, matplotlib, etc. on Windows
Install Python on Pidora.
Install mongodb on termux
Install Scrapy on python3
Pylint on Windows Atom
Install docker on Fedora31
Linux (WSL) on Windows
Install numba on CentOS 7.2
Install Ansible on Mac
Install Python on Mac
Install Python 3 on Mac
Install Plone (4.3.6) on MacOSX (10.10.3)
Install PySide2 on Ubuntu
Install Python3.4 on CentOS 6.6
Use pyvenv on Windows
How to quickly install h5py on Windows 10 [Unofficial]
Install gensim on Marvericks
Install JModelica on Ubuntu
Anaconda on Windows Terminal
python basic on windows ②
Install numpy on Marvericks
Install enebular-agent on Chromebook
Install mecab-python on CentOS
Install Python 2.7.3 on CentOS 5.4
Build TensorFlow on Windows
Install aws-cli on MacPorts