theano import error (win10 python2.7)
PHP中文网
PHP中文网 2017-04-18 10:32:09
[Python讨论组]

因为项目需要,在win10-64位电脑上配置theano.
但是一直有 import error的错误,找不到解决方法。
作为一个python新手,实在搞不定,请大家不吝赐教!小女子不胜感激!

按照网上的教程,安装了anaconda2, 版本是4.2.0;
conda install mingw libpython安装了mingw libpython;mingw版本是4.7,libpython版本是2.0
修改了系统的环境变量如下:

在系统变量中添加了PYTHONPATH 变量值为 E:AnacondaLibsite-packagestheano

在cmd窗口的起始目录下,新建了 .theanorc.txt 文件(按照教程来的)

在cmd窗口里输入pip install theano安装了theano,版本是0.9.0

在cmd中打开python,输入:import theano 之后出现错误提示信息:
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named theano

然后我在Spyder的Ipython console中输入:import theano
出现了不一样的import error:
Traceback (most recent call last):
File "", line 1, in

import theano

File "E:Anacondalibsite-packagestheano__init__.py", line 66, in

from theano.compile import (

File "E:Anacondalibsite-packagestheanocompile__init__.py", line 10, in

from theano.compile.function_module import *

File "E:Anacondalibsite-packagestheanocompilefunction_module.py", line 18, in

from theano import config, gof

ImportError: cannot import name gof
如图:

有人说可能是存在多个版本的theano,但我只安装过这个版本。
用pip uninstall theano卸载了之后,又pip install theano,还是没有解决这个问题。
有人说是因为有cygwin和Mingw,cygwin的环境变量path还在mingw之前,可我并没有cygwin这个包。
总之试了一些方法,仍然解决不了我的问题。

不知该怎么解决,希望大家给些帮助,谢谢!

PHP中文网
PHP中文网

认证0级讲师

全部回复(0)
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号