Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

python

theano

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 "help", "copyright", "credits" or "license" for more information.
>>> import theano
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/theano/__init__.py", line 74, in <module>
    from theano.printing import pprint, pp
  File "/usr/local/lib/python2.7/dist-packages/theano/printing.py", line 35, in <module>
    if pd.find_graphviz():
AttributeError: 'module' object has no attribute 'find_graphviz'

What could be the issue, and how to fix it?

I use Theano 0.8.2 on Ubuntu 14.04.4 LTS x64 with Python 2.7.6 x64.


I unsuccessfully tried:

  • sudo apt-get install -y graphviz libgraphviz-dev
like image 228
Franck Dernoncourt Avatar asked Jul 18 '16 22:07

Franck Dernoncourt


2 Answers

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.

like image 131
Tracholar Zuo Avatar answered Oct 20 '22 08:10

Tracholar Zuo


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

like image 45
Adrià Romero López Avatar answered Oct 20 '22 08:10

Adrià Romero López