简体   繁体   中英

Import Theano on Anaconda of platform windows10

I download the theano from github, and install it. But when I try to import the theano in ipython, I meet this problem

In [1]: import theano

ImportError Traceback (most recent call last) <ipython-input-1-3397704bd624> in <module>() ----> 1 import theano

C:\\Anaconda3\\lib\\site-packages\\theano\\__init__.py in <module>() 40 from theano.version import version as version 41 ---> 42 from theano.configdefaults import config 43 44 # This is the api version for ops that generate C code. External ops 41 ---> 42 from theano.configdefaults import config 43 44 # This is the api version for ops that generate C code. External ops

C:\\Anaconda3\\lib\\site-packages\\theano\\configdefaults.py in <module>() 14 15 import theano ---> 16 from theano.configparser import (AddConfigVar, BoolParam, ConfigParam, EnumStr, 17 FloatParam, IntParam, StrParam, 18 TheanoConfigParser, THEANO_FLAGS_DICT)

C:\\Anaconda3\\lib\\site-packages\\theano\\configparser.py in <module>() 13 14 import theano ---> 15 from theano.compat import configparser as ConfigParser 16 from six import string_types 17

C:\\Anaconda3\\lib\\site-packages\\theano\\compat\\__init__.py in <module>() 4 # Python 3.x compatibility 5 from six import PY3, b, BytesIO, next ----> 6 from six.moves import configparser 7 from six.moves import reload_module as reload 8 import collections

C:\\Anaconda3\\lib\\site-packages\\six.py in __get__(self, obj, tp) 90 91 def __get__(self, obj, tp): ---> 92 result = self._resolve() 93 setattr(obj, self.name, result) # Invokes __set__. 94 try:

C:\\Anaconda3\\lib\\site-packages\\six.py in _resolve(self) 113 114 def _resolve(self): --> 115 return _import_module(self.mod) 116 117 def __getattr__(self, attr):

C:\\Anaconda3\\lib\\site-packages\\six.py in _import_module(name) 80 def _import_module(name): 81 """Import module, returning the module after the last dot.""" ---> 82 __import__(name) 83 return sys.modules[name] 84

C:\\Anaconda3\\Lib\\site-packages\\theano\\configparser.py in <module>() 13 14 import theano ---> 15 from theano.compat import configparser as ConfigParser 16 from six import string_types 17 When I get into the files, I indeed can not find configparser.py in the directory, but the original file do not have it neither.

ImportError: cannot import name 'configparser'

Just found the temperary solution , rename configparser.py to config_parser or any other name that are not confilct .

and change name of each module include it to config_parser .

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