question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FileNotFoundError: [Errno 2] "dot" not found in path

See original GitHub issue

Description

I tried to use pydot to plot a decision tree but i got this error, i will provide the code used in order to reproduce that situation Main.py

$ /home/sys-walker/Documentos/PyCharmProjects/PlotDesicionTree/venv/bin/python /home/sys-walker/Documentos/PyCharmProjects/PlotDesicionTree/Main.py

Traceback (most recent call last):
  File "/home/sys-walker/Documentos/PyCharmProjects/PlotDesicionTree/Main.py", line 34, in <module>
    graph.write_png('example1_graph.png')
  File "/home/sys-walker/Documentos/PyCharmProjects/PlotDesicionTree/venv/lib/python3.8/site-packages/pydot.py", line 1743, in new_method
    self.write(
  File "/home/sys-walker/Documentos/PyCharmProjects/PlotDesicionTree/venv/lib/python3.8/site-packages/pydot.py", line 1828, in write
    s = self.create(prog, format, encoding=encoding)
  File "/home/sys-walker/Documentos/PyCharmProjects/PlotDesicionTree/venv/lib/python3.8/site-packages/pydot.py", line 1933, in create
    raise OSError(*args)
FileNotFoundError: [Errno 2] "dot" not found in path.
        ^

Time: 0.002s
sys-walker@(none):sys-walker>

Environment used

  • OS and python version information.
$  cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.2 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.2 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal


(venv) sys-walker@sys-walker:~/Documentos/PyCharmProjects/PlotDesicionTree$ python --version
Python 3.8.5

  • Pydot version used.
pydot version 1.4.2
  • Output of pip freeze command.
$ pip3 freeze
pkg-resources==0.0.0
pydot==1.4.2
pyparsing==2.4.7

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
peternoweecommented, Mar 2, 2021

Do you have Graphviz installed? What is the output of running dot -V from the command line?

1reaction
peternoweecommented, Mar 2, 2021

Should be solved as part of pydot/pydot#218. That PR is currently closed, but I hope to reopen it in the future.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception: "dot" not found in path in python on mac
For me running: brew install gprof2dot. Fixed the problem.
Read more >
[SOLVED] OSError: [Errno 2] "dot" not found in path.
When trying to visualize data using pydot in Python you might run into an error where it is stated that “dot” is not...
Read more >
FileNotFoundError: [Errno 2] "dot" not found in path - Streamlit
I tried to deploy my app on Streamlit share. But I ran into the error: FileNotFoundError: [Errno 2] “dot” not found in path....
Read more >
FAQ - QSDsan 1.2.1
FileNotFoundError : [Errno 2] No such file or directory: 'dot' ... ['dot', '-Kdot', '-Tpng'], make sure the Graphviz executables are on your systems'...
Read more >
failed to import pydot. you must install pydot and graphviz for ...
FileNotFoundError: (Errno 2) dot'' not found in path ... In other words, you can make sure that the user has indeed typed a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found