Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Theano on Windows with Python 3.5 probably don't work #3376
Maybe we should switch to MSVC directly and not mingw? Or just wait to have mingw support it?
That's a very nice write-up! I haven't gone through the whole blog post, but I just wanted to add that I'm successfully (modulo a few minor issues) using Theano with msys2-mingw64 and python3.5. I've installed their mingw64 python3.5, numpy, scipy, pip3 from pacman, and then installed Theano from pip3.
"Probably, why not" on windows with CUDA make me smile. I hope it is now as
On Sun, Dec 20, 2015 at 4:18 PM, Patrik Huber email@example.com
Hehe yea, I can only imagine! I currently can't try with CUDA, maybe in the future. Hopefully other people can chime in :-) It would be great if it worked with msys2-mingw64, since msys2 is awesome and useful for many purposes, so you don't have to have several mingw distributions and each of them comes with their own gcc and takes up space etc. (e.g. most Python distributions for Windows come with their own mingw).
referenced this issue
Apr 5, 2016
added a commit
May 17, 2016
added a commit
May 17, 2016
This was referenced
May 17, 2016
added a commit
May 18, 2016
Something interesting that may just help others.
I also experienced the C/C++ compiler and importing issues when I had
The errors I experienced:
However, when I changed to:
For completeness, my entire .theanorc.txt file content (stored in c:\Users\ is
Important to note, even with correctly pre-compiled files in the base_compiledir done with the second g++.exe, the initial g++.exe was unable to import them correctly.
Some interest results to show that it does work in fact:
device=cpu, cxx =
device=cpu, cxx = C:\MinGw64\mingw64\bin\g++.exe
The GPU result just means I have a slow GPU compared to my CPU for this specific type of task, which is true (Corei7-2670QM vs Nvidia NVS 4200).
Hope this can help someone. May just be a fluke, but it works.
I definitely had to run "msys.bat" (and run other commands within that window), but first had to edit it, as it did not want to execute on my pc at first. Something to do with being unable to find the WD (working directory).
For completeness, here's the contents of my msys.bat, in case someone also struggles with a similar error:
The above file also only ran when I did NOT do it as administrator. If I did "run it as administrator", it did not leave the msys command window open.
Other issues I experienced was folder write rights issues due to our corporate policy, so I ended up installing everything in C: root, rather than in program files, etc etc. That sorted out a lot.
Another tutorial that helped in the end, which I found quite helpful:
I have successfully installed theano release 0.8.2 with Python 3.5
You can just comment the raising of that error. Then it should continue to
What did you do to make Theano work with python 3.5? We don't have time for
On Fri, Jul 22, 2016 at 12:52 PM, ruslanagit firstname.lastname@example.org
Well, the main problem with Python 3.5 on windows, I guess, is that mingw and libpython are not available (not complied with Python 3.5), so you cannot run $ conda install mingw libpython
All other installations/configurations were done as described in the guide for installaing Theano on Windows.
Hi, I am trying to get theano to work with PyCharm. I switched from 3.5 to 3.4 and have tried some of the things above but none seem to be working. I'm running into 2 errors:
nvcc : fatal error : Wrong syntax in file C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\bin/nvcc.profile: "2010"
Interestingly this error showed up in Spyder and Pycharm but after adding this:
compiler-bindir = C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
which I found in another thread, CUDA worked in Spyder but stayed broken in Pycharm.
And the second is that it is not recognizing the .theanorc file which I figured out trying to install it before and getting help with the author of the link below. I made that file and theano works with Spyder and the installation instructions found here:
I really prefer PyCharm but don't know where to put the settings or how to make it find .theanorc
Does anybody have any ideas please?
Got some time to try it. Found my path to simply be c:\Users\Anon so put .theanorc there.
May be a little closer but not sure. It now gives the following error for the loading of CUDA:
nvcc : fatal error : Compiler 'cl' in PATH different than the one specified with -ccbin
I'm not sure where -ccbin is defined.
I also found suggestions to change my .theanorc file and found that adding the following helped me get to this new error:
So now I am hopeful that if I can find the -ccbin path definition then it might work. Google hasn't been helpful so far but still working on it.
Does anyone have other ideas please?
BTW I'd like to change my default path which I found from the "os.path.expanduser('~')" suggestion from c:\users\anon to a more python related directory. How do I change that path please?
@junk-anon I'm not able to help you debug your issue as I have no idea whats going wrong, but here is the full installation steps that I followed written out in a simple manner in case I have to re-do it at some stage.. Maybe something in here helps you.:
Installing Theano (the underlying package for most NN wrappers)
the most helpful: http://simranmetric.com/category/tutorials/
First, read the first two references to get a feel for what needs to be done.
This installation worked for Win 8.1, 64 Bit, Python 3.5
Prorgams to Install And Folder where I installed (which in some cases should avoid being in folders like Windows, Program Files, Users, etc, where there may be permission issues)
AnaConda c:\AnaConda3\ Required
Also created a folder "C:\TheanoOperational", which you will see is referenced in the setup files below as the folder where theano will pre-compile C-Code
conda install mingw libpython (as an alternative to get all dependencies did not work for me at the time as the mingw library was not updated at that point to support Python 3.5 (which was the version I ran with).
use the msys.bat file that I commented previously in this thread. I made a single change, because it did not want to run on my ocmputer.
cuDNN from CUDA (optional)
The only thing that worked for me was to manually copy the CuDNN files (in the SIP folder) into the appropriate folders in your CUDA installation.
Full set of environmental variables (some are created automatically by their installers):
When changing paths, make sure to restart the computer. The PATHS enviromental variable are not updated properly in Windows until a restart! This bit me - wasted a lot of time. Never knew it, but it really made a difference on at least one occasion.
CUDA_PATH C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5
Content of ".theanorx.txt" settings file (to be saved in C:\Users\ See http://deeplearning.net/software/theano/library/config.html for more info
STUFF THAT WAS PROBABLY REDUNDANT/UNECESSARY