MJL85 / natlas

natlas - Network Discovery and Auto-Diagramming
GNU General Public License v2.0
511 stars 110 forks source link

Exception Error - "dot" not found in path. #64

Open Marct27 opened 3 years ago

Marct27 commented 3 years ago

Issues when running this on OSX and Windows, have tried with Python 3.6.8 and 3.9.x


natlas v0.12.1
Michael Laforest <mjlaforest@gmail.com>
Python 3.6.8

     Config file: ./natlas.conf
     Output file: .\network.svg
Out Catalog file: None
       Root node: 192.168.146.254
  Discover depth: 100
   Diagram title: natlas Diagram

Discovery codes:
    . depth             ! connection error
    + discovering node  > numerating adjacencies
    i include node      L leaf node

Discovering network...
1  [root]  +UnifiSwitch16PoE (192.168.146.254)
   [root]  >UnifiSwitch16PoE (192.168.146.254)

Collecting node details...
[1/1]+ UnifiSwitch16PoE (192.168.146.254) 0.78 sec

Back filling node details...
Traceback (most recent call last):
  File "C:\Users\marc\AppData\Local\Programs\Python\Python36\lib\site-packages\pydot.py", line 1915, in create
    working_dir=tmp_dir,
  File "C:\Users\marc\AppData\Local\Programs\Python\Python36\lib\site-packages\pydot.py", line 136, in call_graphviz
    **kwargs
  File "C:\Users\marc\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "C:\Users\marc\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 1017, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\PythonProjects\natlas\natlas-cli.py", line 305, in <module>
    main(sys.argv[1:])
  File "E:\PythonProjects\natlas\natlas-cli.py", line 96, in main
    exec_mod(mod, argv[1:])
  File "E:\PythonProjects\natlas\natlas-cli.py", line 167, in exec_mod
    modret = module.entryfunc(natlas_obj, argv)
  File "./modules\diagram.py", line 88, in mod_entry
    if (opt_output != None):    natlas_obj.write_diagram(opt_output, opt_title)
  File "E:\PythonProjects\natlas\natlas\natlas.py", line 125, in write_diagram
    self.diagram.generate(output_file, diagram_title)
  File "E:\PythonProjects\natlas\natlas\output_diagram.py", line 108, in generate
    output_func(f)
  File "C:\Users\marc\AppData\Local\Programs\Python\Python36\lib\site-packages\pydot.py", line 1734, in new_method
    encoding=encoding)
  File "C:\Users\marc\AppData\Local\Programs\Python\Python36\lib\site-packages\pydot.py", line 1817, in write
    s = self.create(prog, format, encoding=encoding)
  File "C:\Users\marc\AppData\Local\Programs\Python\Python36\lib\site-packages\pydot.py", line 1922, in create
    raise OSError(*args)
FileNotFoundError: [WinError 2] "dot" not found in path.```
marcolussetti commented 3 years ago

This library requires Graphiviz's dot executable to be installed and in the path.

On most Linux distro the package manage would serve it.

On Mac OS X homebrew will install it just fine:

brew install graphviz

On Windows you'll want to get the upstream installer and add it to your path (or just use WSL).

kacesensitive commented 3 years ago

On windows install Grpahviz then add dot to your path "ProgramFiles/Graphviz/bin"