alan-turing-institute / rds-course

Materials for Turing's Research Data Science course
https://alan-turing-institute.github.io/rds-course/
31 stars 13 forks source link

Issue on page /modules/m4/4.1-WhatAndWhy.html #170

Open prestevez opened 1 year ago

prestevez commented 1 year ago

The first and last code blocks throw an error. I think it is due to a missing graphviz package.

I recloned the repo and reinstalled the poetry dependencies, but the error persists.

Error message (it is the same for both code blocks):

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
~/.cache/pypoetry/virtualenvs/rds-course--MwjGM7k-py3.8/lib/python3.8/site-packages/graphviz/backend/execute.py in run_check(cmd, input_lines, encoding, quiet, **kwargs)
     78                 kwargs['stdout'] = kwargs['stderr'] = subprocess.PIPE
---> 79             proc = _run_input_lines(cmd, input_lines, kwargs=kwargs)
     80         else:

~/.cache/pypoetry/virtualenvs/rds-course--MwjGM7k-py3.8/lib/python3.8/site-packages/graphviz/backend/execute.py in _run_input_lines(cmd, input_lines, kwargs)
     98 def _run_input_lines(cmd, input_lines, *, kwargs):
---> 99     popen = subprocess.Popen(cmd, stdin=subprocess.PIPE, **kwargs)
    100 

/usr/lib/python3.8/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, text)
    857 
--> 858             self._execute_child(args, executable, preexec_fn, close_fds,
    859                                 pass_fds, cwd, env,

/usr/lib/python3.8/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)
   1703                         err_msg = os.strerror(errno_num)
-> 1704                     raise child_exception_type(errno_num, err_msg, err_filename)
   1705                 raise child_exception_type(err_msg)

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

The above exception was the direct cause of the following exception:
...
---> 84             raise ExecutableNotFound(cmd) from e
     85         raise
     86 

ExecutableNotFound: failed to execute PosixPath('dot'), make sure the Graphviz executables are on your systems' PATH
<graphviz.graphs.Digraph at 0x7f7ea8f34490>
craddm commented 1 year ago

This is a missing system dependency - you beat me to reporting this one. On Mac, brew install graphviz will do it. Otherwise, check the Graphviz website. We'll work out how to fix this for the future.

jack89roberts commented 1 year ago

Could solve it by using a conda environment I think (or adding it to the setup instructions, but as per #112 poetry isn't the right choice for this course imo).