lisa-lab/pylearn2

imporing theano.compat.six fails

Opened this issue · 3 comments

According to this issue, import statements with theano.compat.six should be replaced by import six (or from six import ...). Replacing all import statements appears to have solved the issue.

nouiz commented

exact. But there isn't any maintainer of this repo. If someone make a PR, maybe I'll review it, but this isn't even sure.

I would love to see this work. has anyone set up a pull request yet?

I ran two bash lines which took care of it. So far at least...

files="$(egrep -r 'theano\.compat\.six' ./*)"
found="$(for x in ${files}; do echo $(sed -nre 's/([-\_a-zA-Z0-9]+\.py)(.*)/\1/gp' <<<"${x}"); done | uniq)"
for xx in ${found}; do sed -i -re 's/theano\.compat\.six/six/g' ${xx}; done

and then finally

files="$(egrep -r 'from theano\.compat import six' ./*)"
found="$(for x in ${files}; do echo $(sed -nre 's/([-\_a-zA-Z0-9]+\.py)(.*)/\1/gp' <<<"${x}"); done | uniq)"
for xx in ${found}; do sed -i -re 's/from theano\.compat import six/import six/g' ${xx}; done

This appears to deal with all of the issues making trouble for six versus theano.compat.six.