How I installed Theano on Windows - marczellm/algorimp GitHub Wiki

Theano doesn't like paths that contain spaces or non-ASCII characters, so keep that in mind when installing stuff. My Windows username is Márton, so I had to specify a different directory because Theano tried and failed to use C:\Users\Márton\AppData as the compiledir.

  1. Download and install MSYS2 from http://msys2.github.io. Follow their instructions to refresh the package database.

  2. Install the MinGW compiler:

    1. for 32-bit:

        pacman -S mingw-w64-i686-gcc
      
    2. for 64-bit:

        pacman -S mingw-w64-x86_64-gcc
      
  3. Add the compiler binary directory to PATH. This in my case is D:\msys2\mingw64\bin\

  4. Install NumPy and SciPy from Christoph Gohlke.

    1. Download the appropriate wheels for your Python version and architecture.
    2. pip install with the wheel filename as argument.
  5. pip install Theano

  6. My .theanorc is at C:\Users\Márton\.theanorc and the contents are:

         [global]
         base_compiledir = D:\theano\
    
         [gcc]
         cxxflags = -D_hypot=hypot
    

The cxxflags are there to fix an include error with cmath during compilation.