Deep Learning – Simple installation guide for Theano on Windows
Many tutorial videos for convolutional neural networks on youtube (e.g. https://www.youtube.com/watch?v=S75EdAcXHKk)
require the theano python library.
I spent an entire weekend figuring out how to install theano on a windows x64 machine and wanted to share the following quick installation steps:
Its really simple if you know how! (I found that the official documentation on deeplearning.net is a bit overwhelming pointing to so many resources and alternatives. You often end up with misconfigured PATH variables or missing files or wrong compilers etc.)
The following is how it worked for me on a Windows 10 x64 Machine with Visual Studio 2015.
1) Download Anaconda for Windows x64 for Python 2.7 (Dont use the Python 3.5 it will not work!)
https://www.continuum.io/downloads
2) After anaconda installation open a command prompt and execute:
conda install mingw libpython
Confirm when it asks for updates!
3) Clone the theano project to your local machine from github. (I assume you know how github works if not check https://www.youtube.com/watch?v=0fKg7e37bQE)
git clone https://github.com/Theano/Theano.git
4) Open a command prompt and navigate to the theano project folder and execute:
python setup.py install
Done! This has installed theano in your global python environment.
You can test your installation by creating a test.py file with the following code line:
import theano
In a command prompt navigate to the folder containing the test.py file and execute:
python test.py
Btw. as far as I understand, further steps would be required to make theano use the GPU! The installation above would only use the CPU for calculations.
Worked so easily for me after struggling wilth all previous attempts, thanks!
Thanks a lot! I tried installing g++ both via cygwin and some TDM-something thing, both wouldn’t work, throwing cryptic error messages. This finally does!
Thank you very much , I’ve been searching and trying for about 6 hours till I found this guide , it was extremely useful.
happy to help! i also published a blogpost on how to activate the GPU for theano here: https://lukassteindlblog.wordpress.com/2016/03/31/
Hello Lukas, Please tell me whether there is a way to install Theano to work on Python 3.5? Thanks.
Unfortunately there is no way to make it run on 3.5 atm.
Thanks anyway.
winPython comes with Theano already installed. Current version uses python 3.
theano supports py3.4, not 3.5
Thanks so much! I went to 5 or 6 places before I found this.
Thanks so much for clear & simple guidelines to install Theano. I’ve gone through 4-5 sites & spending countless hours to figure this out but none of them worked.
With your help I was able to do it so quickly, wish I had came across this earlier
Just one query – how do I make it to work with Python 3.x?
i want to kown how to uninstall it
just uninstall your anaconda pyhton environment under control panel/ add remove programs would be an option
Thank you very much for your post, I try to do the same steps: But i find this problem while testing thr file test.py; I would e very grateful if you could help me please:
Problem occurred during compilation with the command line below:
“g++” -shared -g -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64 -I”C:\Users\msmache\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\lib\site-packages\numpy\core\include” -I”C:\Users\msmache\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\include” -I”C:\Users\msmache\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\lib\site-packages\theano-0.9.0dev4-py2.7.egg\theano\gof” -L”C:\Users\msmache\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\libs” -L”C:\Users\msmache\WinPython-64bit-2.7.6.4\python-2.7.6.amd64″ -o C:\Users\msmache\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-2.7.6-64\lazylinker_ext\lazylinker_ext.pyd C:\Users\msmache\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-2.7.6-64\lazylinker_ext\mod.cpp -lpython27
The system cannot find the path specified.
Traceback (most recent call last):
File “test.py”, line 1, in
import theano
File “C:\Users\msmache\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\lib\site-packages\theano-0.9.0dev4-py2.7.egg\theano\__init__.py”, line 66, in
from theano.compile import (
File “C:\Users\msmache\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\lib\site-packages\theano-0.9.0dev4-py2.7.egg\theano\compile\__init__.py”, line 10, in
from theano.compile.function_module import *
File “C:\Users\msmache\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\lib\site-packages\theano-0.9.0dev4-py2.7.egg\theano\compile\function_module.py”, line 21, in
import theano.compile.mode
File “C:\Users\msmache\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\lib\site-packages\theano-0.9.0dev4-py2.7.egg\theano\compile\mode.py”, line 10, in
import theano.gof.vm
File “C:\Users\msmache\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\lib\site-packages\theano-0.9.0dev4-py2.7.egg\theano\gof\vm.py”, line 659, in
from . import lazylinker_c
File “C:\Users\msmache\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\lib\site-packages\theano-0.9.0dev4-py2.7.egg\theano\gof\lazylinker_c.py”, line 127, in
preargs=args)
File “C:\Users\msmache\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\lib\site-packages\theano-0.9.0dev4-py2.7.egg\theano\gof\cmodule.py”, line 2309, in compile_str
(status, compile_stderr.replace(‘\n’, ‘. ‘)))
. ception: Compilation failed (return status=1): The system cannot find the path specified.