Importing theano: AttributeError: 'module' object has no attribute 'find_graphviz'

后端 未结 4 771
太阳男子
太阳男子 2020-12-28 09:12

When I run import theano in Python, I get the following error message:

Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type          


        
相关标签:
4条回答
  • 2020-12-28 09:34

    For some reason, the Python module pydot was creating the issue:

    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    >>> import pydot
    >>> pydot.find_graphviz()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: 'module' object has no attribute 'find_graphviz'
    

    I was using pydot 1.2.2.

    I uninstalled it using sudo pip uninstall -y pydot, and I then was able to successfully import theano.

    Bug report: https://github.com/Theano/Theano/issues/4759

    0 讨论(0)
  • 2020-12-28 09:42

    I solved by installing pydot-ng --> $ pip install pydot-ng

    0 讨论(0)
  • 2020-12-28 09:49

    In pydot 1.2.x version,find_graphviz function have been deprecated. To fix this issue, you should install pydot 1.1.0 version here https://github.com/erocarrera/pydot/tree/v1.1.0 . And it is work for me. May help.

    0 讨论(0)
  • 2020-12-28 09:50

    I solved it by using

    sudo pip install graphviz
    sudo apt-get install graphviz
    

    with the pydot version 1.2.3 works fine

    0 讨论(0)
提交回复
热议问题