ImportError: cannot import name 'configparser' during installing Theano-0.8.2

2,338 views
Skip to first unread message

Tejas Godambe

unread,
Jun 25, 2016, 12:47:19 PM6/25/16
to theano-dev
Hi, 

I am trying to install Theano from source above python3.4. I downloaded the tarball from https://pypi.python.org/pypi/Theano.
I was able to successfully install 
1. numpy-1.11.0
2. scipy-0.19.0
3. setuptools-23.1.0
4. six-1.10.0
5. cython-0.24

All above were installed from source, and I'm able to import them using python3.4. 

Theano installation completed successfully. But when I import theano, it throws the following error. Any clue what may be going wrong? 
Our admin has already installed Theano-0.8.2 over Python3.4. But, he used pip. 
I am installing using source because I wanted to have a local copy which I can modify and keep experimenting. 

####
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/tejas/tools/python-3.4.0/lib/python3.4/site-packages/theano/__init__.py", line 42, in <module>
    from theano.configdefaults import config
  File "/home/tejas/tools/python-3.4.0/lib/python3.4/site-packages/theano/configdefaults.py", line 16, in <module>
    from theano.configparser import (AddConfigVar, BoolParam, ConfigParam, EnumStr,
  File "/home/tejas/tools/python-3.4.0/lib/python3.4/site-packages/theano/configparser.py", line 15, in <module>
    from theano.compat import configparser as ConfigParser
  File "/home/tejas/tools/python-3.4.0/lib/python3.4/site-packages/theano/compat/__init__.py", line 6, in <module>
    from six.moves import configparser
  File "/home/tejas/tools/python-3.4.0/lib/python3.4/site-packages/six-1.10.0-py3.4.egg/six.py", line 92, in __get__
    result = self._resolve()
  File "/home/tejas/tools/python-3.4.0/lib/python3.4/site-packages/six-1.10.0-py3.4.egg/six.py", line 115, in _resolve
    return _import_module(self.mod)
  File "/home/tejas/tools/python-3.4.0/lib/python3.4/site-packages/six-1.10.0-py3.4.egg/six.py", line 82, in _import_module
    __import__(name)
  File "/home/tejas/tools/python-3.4.0/lib/python3.4/site-packages/theano/configparser.py", line 15, in <module>
    from theano.compat import configparser as ConfigParser
ImportError: cannot import name 'configparser'

Thanks, 

Pascal Lamblin

unread,
Jun 27, 2016, 5:34:02 PM6/27/16
to thean...@googlegroups.com
This can happen if different versions of the same package are installed
at the same time.

You can try to play with the PYTHONPATH environment
variable or sys.path in Python, to make your version of Theano visible
before the system one.

Another option would be to use a virtualenv or Conda environment.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "theano-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to theano-dev+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


--
Pascal

謝秉叡

unread,
Apr 14, 2017, 12:24:36 PM4/14/17
to theano-dev
I can't solve the problem...
I kept getting the same error...
How can i fix it
What do you mean "play with PYTHONPATH environment"?
My PYTHONPATH is    E:\Anaconda3\Lib\site-packages\theano;
Is that wrong?
Thank you!!

Pascal Lamblin於 2016年6月28日星期二 UTC+8上午5時34分02秒寫道:
Reply all
Reply to author
Forward
0 new messages