Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Name conflicting in Theano

I am trying to import theano in a module, but I am getting a traceback:

File "/media/tarun/6A86CA8286CA4DEF/develop/pydy/pydy/codegen/code.py", line 16, in <module>
import theano
File "/usr/local/lib/python2.7/dist-packages/theano/__init__.py", line 44, in <module>
from theano.gof import \
File "/usr/local/lib/python2.7/dist-packages/theano/gof/__init__.py", line 38, in <module>
from theano.gof.cc import \
File "/usr/local/lib/python2.7/dist-packages/theano/gof/cc.py", line 55, in <module>
StrParam(""))
File "/usr/local/lib/python2.7/dist-packages/theano/configparser.py", line 223, in AddConfigVar
  root=newroot, in_c_key=in_c_key)
File "/usr/local/lib/python2.7/dist-packages/theano/configparser.py", line 227, in AddConfigVar
configparam.fullname)
AttributeError: ('This name is already taken', 'gcc.cxxflags')

It seems that there is some name conflict in some config. Can anybody please point me to the same.

like image 243
Tarun Gaba Avatar asked Nov 01 '22 18:11

Tarun Gaba


1 Answers

This error happens because some module, probably theano.gof, is imported twice. Usually, this is because a first call to import theano.gof gets started, registering 'gcc.cxxflags' in the configuration parser a first time, but then raises ImportError, which is catched and ignored. Then, import theano.gof gets called again, tries to register the option again, which raises the exception you get.

Is there any traceback or error message before this one, or something that would give a hint of why the first import failed?

like image 157
Pascal Lamblin Avatar answered Nov 15 '22 04:11

Pascal Lamblin