场景:从python2通过activate Python36切换到python3.6环境后,在python中import theano时,出现import theano ModuleNotFoundError: No module named 'theano'的错误,(即便在python2下又已经安装过theano)。为了解决缺theano的问题,要做两个动作:
1、从环境变量中,删除pythonpath:因为pip会利用这个pythonpath搜索theano,如果python2下已经安装过theano,就会阻止pip安装theano;
2、重启电脑;
3、尽量用conda安装theano,尤其是在windows:conda install theano pygpu
4、或者在python36环境下安装对应版本的theano:pip install theano;