CapsNet-Keras: ImportError: You must install pydot and graphviz for `pydotprint` to work.
When I run capsulenet.py, I have this error:
ImportError: Failed to import pydot. You must install pydot and graphviz for pydotprint to work.
But, I have installed pydot and graphviz: pydot==1.2.3 graphviz==0.8.1
Any idea?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 16 (1 by maintainers)
sudo apt-get install graphvizJust in case someone using windows might need it, modify the
pydot.pyfile. It should be in<python_install_path>\Lib\Site-packages\pydot.py. Besidespip install pydotandpip install graphviz, also install graphviz software. And add the softwarebindirectory to the system’s path. And inclass Dot(Graph), changeself.prog = 'dot'toself.prog = 'dot.exe'Seems that the package was written for *nix system. So in windows, assign it to be an
.exefile.I was able to get it to work with Tensorflow 2 on Ubuntu with:
I got this to work by “brew install graphviz”.
try https://github.com/XifengGuo/CapsNet-Keras/issues/7
pip install graphvizwithin my conda env solved it for mep.s. I also tried
conda install graphvizbut problem persistedSolved. I commented the
plot_modelline.Thanks you. Good code @XifengGuo
Install pydot, graphviz using conda/pip Add a couple of changes in
<python_install_path>\Lib\Site-packages\pydot.pyas below:return.bat didn’t exist in Graphviz install directory.
For some reason subprocess.Popen was not able to find ‘dot.exe’ from my system (I had Graphviz/bin to the system path variables), used absolute path instead and it worked!
conda install graphviz
solved the problem for me
hi @bukosabino, can you tell me what you commented out to get the
plot_modelto work?This fixed it for me on my Mac.