CapsNet-Keras: ImportError: Failed to import `pydot`. Please install `pydot`. For example with `pip install pydot`.
from keras.utils import plot_model plot_model(model)
Showing this error.
ImportError: Failed to import pydot. Please install pydot. For example with pip install pydot.
- I installed –
(base) C:\Users\lohit>pip install pydot Requirement already satisfied: pydot in c:\users\lohit\anaconda3\lib\site-packages (1.2.4) Requirement already satisfied: pyparsing>=2.1.4 in c:\users\lohit\anaconda3\lib\site-packages (from pydot) (2.2.0)
(base) C:\Users\lohit>pip install pydotplus Requirement already satisfied: pydotplus in c:\users\lohit\anaconda3\lib\site-packages (2.0.2) Requirement already satisfied: pyparsing>=2.0.1 in c:\users\lohit\anaconda3\lib\site-packages (from pydotplus) (2.2.0)
(base) C:\Users\lohit>pip install pydot_ng Requirement already satisfied: pydot_ng in c:\users\lohit\anaconda3\lib\site-packages (1.0.0) Requirement already satisfied: pyparsing>=2.0.1 in c:\users\lohit\anaconda3\lib\site-packages (from pydot_ng) (2.2.0)
(base) C:\Users\lohit>pip install graphviz Requirement already satisfied: graphviz in c:\users\lohit\anaconda3\lib\site-packages (0.9)
Still, it’s showing an error? Kindly help me with this issues.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (1 by maintainers)
In addition to pydot and graphviz install pydotplus. This should solve your problem.
Edit: I overlooked that you already installed pydotplus, my bad. Try uninstalling all pydot related modules and graphiviz, then reinstall in the following order:
For me, this has done the trick on both a Linux and Windows machine.
Try this 😃
I followed the advice of uninstalling and reinstalling pydot + pydotplus and that successfully solved the issue on my Windows 10 machine using Anaconda 3.
conda uninstall pydotconda uninstall pydotplusconda uninstall graphvizthenconda install pydotconda install pydotplusNote: installing pydot also installed graphvizJust like @anouar1991 said.
What I did are followed:
import kerasimport pydotplusfrom keras.utils.vis_utils import model_to_dotkeras.utils.vis_utils.pydot = pydotplot_model(autoencoder, to_file='model.png')That’s worked for me.
On Ubuntu 16.04, I try with: sudo apt-get install python-pydot and it worked ok.
i m having the same problem but the process of uninstalling and installing all the modules doesn’t work for me plss help
@jmikedupont2 thanks it worked after a struggle of 1 hr I found this worked for me