ImportError: Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work February 21, 2023 by Tarik The following commands solved the problem for me pip install pydot pip install pydotplus sudo apt-get install graphviz