4

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?

soroosh.strife
  • 1,181
  • 4
  • 19
  • 45

3 Answers3

4

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

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
yaque
  • 41
  • 1
  • Changing just setup was not enough for me, since internally pylearn2 use six package from Theano and it causes the same issue on execution stage, so the only option was to downgrade Theano as you described – Vyacheslav Tsivina Nov 27 '19 at 16:19
3

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

2

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