lisa-lab / pylearn2

Warning: This project does not have any current developer. See bellow.
BSD 3-Clause "New" or "Revised" License
2.75k stars 1.09k forks source link

imporing theano.compat.six fails #1591

Open koenhelwegen opened 6 years ago

koenhelwegen commented 6 years ago

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 6 years ago

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.

mathemaphysics commented 5 years ago

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

mathemaphysics commented 5 years ago

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.