Ubuntu18.04安装Theano出现“No module named 'theano.compat.six'”

ubuntu18.04安装Theano出现“No module named ‘theano.compat.six’”

如题,安装pylean2时,当执行python setup.py build后出现:

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

解决办法
直接在下载好pythearn2包的目录下,对setup.py文件进行修改,这里要用到vim编辑器,直接输入:
vim setup.py
进入setup.py之后,将
from theano.compat.six.moves import input 改为
from six.moves import input
然后 “Esc” + “ :” + “ wq ” + 回车键

接着继续执行python setup.py build ,就OK啦!

好像是Theano版本太高了还是怎滴..

猜你喜欢

转载自blog.csdn.net/qq_43232373/article/details/82999076