简体   繁体   中英

Installing theano on Windows 7 x64 (cannot import name gof)

I am trying to install Theano on my Windows 7 x64 machine. I have followed about 5 different tutorials trying to get it installed properly. Some of them are in these links:

http://deeplearning.net/software/theano/install_windows.html

https://www.kaggle.com/c/otto-group-product-classification-challenge/forums/t/13973/a-few-tips-to-install-theano-on-windows-64-bits

On the Kaggle site I tried the Anaconda and WinPython recommendations... I've tried using Python 2.7 and 3.5... it doesn't seem to matter what I do; I keep getting the following error(s) when I run

import theano

in my python environment:

...
^~~~~;mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev1/mingw64/lib/gcc/x86_64-w64-mingw32/6.2.0/include/c++/cmath:1133:11: error: '::hypot' has not been declared\mod.cpp:1:/c++/math.h:36:0,

That's what I get the first time I try to import theano. If I try a second time in the same session I get

...
from theano import config, gof

ImportError: cannot import name gof

I found this other question on stackoverflow that makes it seem that I have an old version of Theano installed causing the problem. I already ran

pip uninstall theano

and it is no longer installed. Is there another way to uninstall it that I'm missing? Or do I have another issue?

I resolved my own problem here. If anyone else out that encounters this, I did the following to resolve it

  1. Remove every version of Theano you can find; pip uninstall theano , conda remove theano , and search your file system for Theano files that might be lingering around
  2. I also had a couple of versions of mingw on my machine. Remove all of those as well; I started with the standard window uninstall. I was also able to find another installation squirreled away in my file system that had a separate uninstall package that I ran.
  3. Follow the instructions on the 2nd post of this link EXACTLY

I faced the same problem: ImportError: cannot import name gof for Windows 10 64 bit, Python 2.7. I solved by updating conda several times to make sure there are not more updates. I run:

  1. conda update conda
  2. conda update --all

After that in the Python environment of the Anaconda prompt shell,

  1. import theano

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM