installing pylearn2 - ImportError: No module named six.moves

4.9k Views Asked by At

I'm trying to install pylearn2. I'm using a fresh virtual environment where I've only install the development versions of theano and pygpu. I have tested them and both are working fine. However, when I try to install pylearn2 I get this error:

$ python setup.py develop
Traceback (most recent call last):
  File "setup.py", line 8, in <module>
    from theano.compat.six.moves import input
ImportError: No module named six.moves

I have tried installing six as was suggested in some places, but it tells me that it's already been installed:

$ pip install six
Requirement already satisfied: six in /home/virt_env/virt1/lib/python2.7/site-packages

Has anyone else run into this problem?

3

There are 3 best solutions below

0
On

If you have already installed six using pip, then you can fix this by editting the setup.py to directly use six.moves instead of the theano version

1
On

there is a good idea to edit setup.py

from theano.compat.six.moves import input
from six.moves import input

thanks Jyothish Soman this is ok. other

to change the version about Theano like:

pip install Theano==0.8

because pylearn2 have version request

python
import pylearn2
print pylearn2.version.version

you can see

0
On

Theano is not using theano/compat/six.py any more.

Six now is a library, you can install six by using:

pip install six

Then edit the line in setup.py:

from theano.compat.six.moves import input

to

from six.moves import input