Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

keras.utils.plot_model keeps telling me to install pydot and graphviz

Tags:

python

keras

I tried at least 5 different solutions from numerous posts online but to no avail. This is where I'm at:

In my conda virtual environment, I installed pydot, pydotplus, and graphviz via conda. I went to https://www2.graphviz.org/Packages/stable/windows/10/ and installed both cmake and msbuild and added both /bin folders to User PATH and System PATH variables. I've tried uninstalling and reinstalling packages with conda and with pip yet upon running

keras.utils.plot_model(model, to_file='model_test.png', show_shapes=True, show_layer_names=True)

I still get this error message:

('Failed to import pydot. You must pip install pydot and install graphviz (https://graphviz.gitlab.io/download/), ', 'for pydotprint to work.')

I am able to import pydot and graphviz individually via

import pydot
import graphviz

I'm not entirely sure what's the issue here. Thanks in advance.

like image 871
Bryant Avatar asked Oct 30 '25 02:10

Bryant


1 Answers

On Mac:

pip install pydot 
pip install graphviz 

wasn't sufficient.

I had to do a -

brew install graphviz
like image 124
Indi Avatar answered Oct 31 '25 18:10

Indi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!