Python目录中的Theano路径 - RuntimeError

时间:2017-10-26 15:12:17

标签: python tensorflow keras theano

我正在配置python,theano,keras,tensorFlow。我几乎让它工作,但在使用pygpu0.6.9时收到版本错误。所以我更新了theano版本(根据一些说明)。 Aftwerwards,我再次运行测试文件。我没有收到pygpu错误,但我收到了这个错误:

  

“你的Python路径中有theano目录。这样做[原文如此]在Python 3中不起作用。”

这可能是一个简单的修复,但我对此比较陌生。谢谢你的帮助。

PS

C:\program files\anaconda3> python test.py
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    from theano import function, config, shared, tensor
  File "C:\Program Files\Anaconda3\lib\site-packages\theano\__init__.py", line 79, in <module>
    "You have the theano directory in your Python path."
RuntimeError: You have the theano directory in your Python path. This do not work in Python 3.

1 个答案:

答案 0 :(得分:0)

您在关注code

时遇到错误
Level

我不知道为什么,但作者会检查Theano的路径是否在rpath = os.path.realpath(__path__[0]) for p in sys.path: if os.path.realpath(p) != rpath: continue if PY3: raise RuntimeError( "You have the theano directory in your Python path." " This do not work in Python 3.") else: warnings.warn( "You have the theano directory in your Python path." " This is will not work in Python 3.") break (从环境变量PYTHONPATH初始化)。尝试从PYTHONPATH env变量中删除Theano的路径。