[help needed]

While testing openmc on my device, I ran “Modeling a CANDU Bundle” from the example notebook. I was stuck in the middle. When I put

p = openmc.Plot.from_geometry(geom)
p.color_by = ‘material’
p.colors = {
fuel: ‘black’,
clad: ‘silver’,
heavy_water: ‘blue’
}
openmc.plot_inline(p)

into my Jupyter Notebook (which I initiated from my Ubuntu bash on Windows). It returned with an error

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-13-f28818505f7e> in <module>()
      6     heavy_water: 'blue'
      7 }
----> 8 openmc.plot_inline(p)

/home/bchen/anaconda3/lib/python3.5/site-packages/openmc/executor.py in plot_inline(plots, openmc_exec, cwd, convert_exec)
     84                 ppm_file = 'plot_{}.ppm'.format(p.id)
     85             png_file = ppm_file.replace('.ppm', '.png')
---> 86             subprocess.check_call([convert_exec, ppm_file, png_file])
     87             images.append(Image(png_file))
     88         display(*images)

/home/bchen/anaconda3/lib/python3.5/subprocess.py in check_call(*popenargs, **kwargs)
    264     check_call(["ls", "-l"])
    265     """
--> 266     retcode = call(*popenargs, **kwargs)
    267     if retcode:
    268         cmd = kwargs.get("args")

/home/bchen/anaconda3/lib/python3.5/subprocess.py in call(timeout, *popenargs, **kwargs)
    245     retcode = call(["ls", "-l"])
    246     """
--> 247     with Popen(*popenargs, **kwargs) as p:
    248         try:
    249             return p.wait(timeout=timeout)

/home/bchen/anaconda3/lib/python3.5/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)
    674                                 c2pread, c2pwrite,
    675                                 errread, errwrite,
--> 676                                 restore_signals, start_new_session)
    677         except:
    678             # Cleanup if the child failed starting.

/home/bchen/anaconda3/lib/python3.5/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)
   1287                             else:
   1288                                 err_msg += ': ' + repr(orig_executable)
-> 1289                     raise child_exception_type(errno_num, err_msg)
   1290                 raise child_exception_type(err_msg)
   1291 

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

it is very long and I do not grasp what it mean entirely. Does anyone know how to solve this?

Sincerely,
Brian

The ‘convert’ command is used to convert images from the .ppm format (which is what OpenMC generates) into a .png file. If you are on Ubuntu or another debian derivative, you can install imagemagick to get this command:

sudo apt install imagemagick

Best,
Paul

1 Like