Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Message: "make sure the Graphviz executables are on your systems' PATH" #182

Closed
csala opened this issue Aug 10, 2020 · 2 comments · Fixed by #189
Closed

Error Message: "make sure the Graphviz executables are on your systems' PATH" #182

csala opened this issue Aug 10, 2020 · 2 comments · Fixed by #189
Milestone

Comments

@csala
Copy link
Contributor

csala commented Aug 10, 2020

  • SDV version: 0.4.0

Description

SDV depends on graphviz to visualize Metadata. The graphviz dependency has been properly set in the setup.py requirements, but graphviz binaries need to also be installed in the system:

A warning about this should be added in the README and the code should capture the exception and raise a new one providing more precise details about the origin of the error and how to fix it:

  • On Debian-based systems: sudo apt install graphviz
  • On Mac systems: brew install graphviz

Reproducing the error

The error occurs any time the metadata.visualize() method is called within a jupyter Notebook in a system which is missing the graphviz binaries.

This is the error shown:

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
~/.virtualenvs/SDV/lib/python3.6/site-packages/graphviz/backend.py in run(cmd, input, capture_output, check, encoding, quiet, **kwargs)
    163     try:
--> 164         proc = subprocess.Popen(cmd, startupinfo=get_startupinfo(), **kwargs)
    165     except OSError as e:

/usr/lib/python3.6/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors)
    728                                 errread, errwrite,
--> 729                                 restore_signals, start_new_session)
    730         except:

/usr/lib/python3.6/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)
   1363                             err_msg += ': ' + repr(err_filename)
-> 1364                     raise child_exception_type(errno_num, err_msg, err_filename)
   1365                 raise child_exception_type(err_msg)

FileNotFoundError: [Errno 2] No such file or directory: 'dot': 'dot'

During handling of the above exception, another exception occurred:

ExecutableNotFound                        Traceback (most recent call last)
~/.virtualenvs/SDV/lib/python3.6/site-packages/IPython/core/formatters.py in __call__(self, obj)
    343             method = get_real_method(obj, self.print_method)
    344             if method is not None:
--> 345                 return method()
    346             return None
    347         else:

~/.virtualenvs/SDV/lib/python3.6/site-packages/graphviz/files.py in _repr_svg_(self)
    111 
    112     def _repr_svg_(self):
--> 113         return self.pipe(format='svg').decode(self._encoding)
    114 
    115     def pipe(self, format=None, renderer=None, formatter=None, quiet=False):

~/.virtualenvs/SDV/lib/python3.6/site-packages/graphviz/files.py in pipe(self, format, renderer, formatter, quiet)
    136         out = backend.pipe(self._engine, format, data,
    137                            renderer=renderer, formatter=formatter,
--> 138                            quiet=quiet)
    139 
    140         return out

~/.virtualenvs/SDV/lib/python3.6/site-packages/graphviz/backend.py in pipe(engine, format, data, renderer, formatter, quiet)
    242     """
    243     cmd, _ = command(engine, format, None, renderer, formatter)
--> 244     out, _ = run(cmd, input=data, capture_output=True, check=True, quiet=quiet)
    245     return out
    246 

~/.virtualenvs/SDV/lib/python3.6/site-packages/graphviz/backend.py in run(cmd, input, capture_output, check, encoding, quiet, **kwargs)
    165     except OSError as e:
    166         if e.errno == errno.ENOENT:
--> 167             raise ExecutableNotFound(cmd)
    168         else:
    169             raise

ExecutableNotFound: failed to execute ['dot', '-Tsvg'], make sure the Graphviz executables are on your systems' PATH
@JagdishKolhe
Copy link

This is definitely the installation issue of graphviz. I would recommend to verify the path in the terminal where you are visualizing. sudo. I dont get such error on Google Colab.

More information at
https://stackoverflow.com/questions/35064304/runtimeerror-make-sure-the-graphviz-executables-are-on-your-systems-path-aft

@csala csala added this to the 0.4.1 milestone Sep 4, 2020
@csala
Copy link
Contributor Author

csala commented Sep 4, 2020

The exception seems to be raised directly from within IPython core, so we cannot actually catch it to improve the error message.

We will add a runtime warning and notes in the README/tutorials pointing at the Graphviz installation page.

@csala csala closed this as completed in #189 Sep 7, 2020
JonathanDZiegler pushed a commit to JonathanDZiegler/SDV that referenced this issue Feb 7, 2022
* Add working addons

* Add eradicate

* Add dlint

* Decrease complexity (sdv-dev#184)

* Add addon (sdv-dev#186)

* Add `pytest-style` (sdv-dev#192)

* Add addon

* Fix randomized error message

* Add addon (sdv-dev#188)

* Add addon (#191)

* Add `pandas-vet` (sdv-dev#190)

* Add addon

* noqa torch.stack

* remove double quotes (sdv-dev#187)

* Add addon (sdv-dev#185)

* Add `flake8-docstrings` (sdv-dev#193)

* Add addon

* Fix D100

* Add more docstrings

* Fix docstrings

* Update docstrings

* Fix lint

* Add `flake8-builtins` (sdv-dev#189)

* Add addon

* Add variables-names

* Fix bug

* Fix mistakes

* Add `flake8-multiline-containers` (sdv-dev#183)

* Add addon

* Add addon

* Address feedback

* Fix lint

* Fix bugs

* Remove pydoclint

* Ignore D101 errors

* Update ignores
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants