Running the TheisInference notebook on fresh installation results in error

Issue #24 new
Martin Modrák created an issue
  • Installed MUQ via conda into a fresh python3 environment.

When running the cell with

graph.Visualize('PosteriorGraph_Step1.png')
Image('PosteriorGraph_Step1.png')

I get:

sh: 1: dot: not found

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
~/miniconda3/envs/muq/lib/python3.9/site-packages/IPython/core/display.py in _data_and_metadata(self, always_both)
   1299         try:
-> 1300             b64_data = b2a_base64(self.data).decode('ascii')
   1301         except TypeError:

TypeError: a bytes-like object is required, not 'str'

During handling of the above exception, another exception occurred:

FileNotFoundError                         Traceback (most recent call last)
~/miniconda3/envs/muq/lib/python3.9/site-packages/IPython/core/formatters.py in __call__(self, obj, include, exclude)
    968 
    969             if method is not None:
--> 970                 return method(include=include, exclude=exclude)
    971             return None
    972         else:

~/miniconda3/envs/muq/lib/python3.9/site-packages/IPython/core/display.py in _repr_mimebundle_(self, include, exclude)
   1288         if self.embed:
   1289             mimetype = self._mimetype
-> 1290             data, metadata = self._data_and_metadata(always_both=True)
   1291             if metadata:
   1292                 metadata = {mimetype: metadata}

~/miniconda3/envs/muq/lib/python3.9/site-packages/IPython/core/display.py in _data_and_metadata(self, always_both)
   1300             b64_data = b2a_base64(self.data).decode('ascii')
   1301         except TypeError:
-> 1302             raise FileNotFoundError(
   1303                 "No such file or directory: '%s'" % (self.data))
   1304         md = {}

FileNotFoundError: No such file or directory: 'PosteriorGraph_Step1.png'

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
~/miniconda3/envs/muq/lib/python3.9/site-packages/IPython/core/display.py in _data_and_metadata(self, always_both)
   1299         try:
-> 1300             b64_data = b2a_base64(self.data).decode('ascii')
   1301         except TypeError:

TypeError: a bytes-like object is required, not 'str'

During handling of the above exception, another exception occurred:

FileNotFoundError                         Traceback (most recent call last)
~/miniconda3/envs/muq/lib/python3.9/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:

~/miniconda3/envs/muq/lib/python3.9/site-packages/IPython/core/display.py in _repr_png_(self)
   1318     def _repr_png_(self):
   1319         if self.embed and self.format == self._FMT_PNG:
-> 1320             return self._data_and_metadata()
   1321 
   1322     def _repr_jpeg_(self):

~/miniconda3/envs/muq/lib/python3.9/site-packages/IPython/core/display.py in _data_and_metadata(self, always_both)
   1300             b64_data = b2a_base64(self.data).decode('ascii')
   1301         except TypeError:
-> 1302             raise FileNotFoundError(
   1303                 "No such file or directory: '%s'" % (self.data))
   1304         md = {}

FileNotFoundError: No such file or directory: 'PosteriorGraph_Step1.png'

The error does not seem to affect computation (which runs without problems), just the visualisation.

Comments (1)

  1. Matthew Parno

    This is an issue that arises when graphviz is not installed. It doesn’t impact any computations, it just won’t create the PosteriorGraph_Step.png file. However, I think we should make sure that graphviz is installed with the MUQ conda package. I will work on updating our conda recipe to make sure graphviz is installed.

    This is related to Issue 17.

  2. Log in to comment