Skip to content

retina matplotlib backend failing with execnb #702

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

Closed
jph00 opened this issue Aug 1, 2022 · 1 comment
Closed

retina matplotlib backend failing with execnb #702

jph00 opened this issue Aug 1, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jph00
Copy link
Contributor

jph00 commented Aug 1, 2022

The nbdev_test command failed with the following error when I had these two lines in the notebook.

%matplotlib inline
%config InlineBackend.figure_format = 'retina'

Error message of nbdev_test

While Executing Cell #6:
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-0eb3525f3a9a> in <module>
----> 1 get_ipython().run_line_magic('matplotlib', 'inline')
      2 get_ipython().run_line_magic('config', "InlineBackend.figure_format = 'retina'")
      3
      4 import pandas as pd

~/Library/Python/3.7/lib/python/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
   2334                 kwargs['local_ns'] = self.get_local_scope(stack_depth)
   2335             with self.builtin_trap:
-> 2336                 result = fn(*args, **kwargs)
   2337             return result
   2338

<decorator-gen-101> in matplotlib(self, line)

~/Library/Python/3.7/lib/python/site-packages/IPython/core/magic.py in <lambda>(f, *a, **k)
    185     # but it's overkill for just that one bit of state.
    186     def magic_deco(arg):
--> 187         call = lambda f, *a, **k: f(*a, **k)
    188
    189         if callable(arg):

~/Library/Python/3.7/lib/python/site-packages/IPython/core/magics/pylab.py in matplotlib(self, line)
     97             print("Available matplotlib backends: %s" % backends_list)
     98         else:
---> 99             gui, backend = self.shell.enable_matplotlib(args.gui.lower() if isinstance(args.gui, str) else args.gui)
    100             self._show_matplotlib_backend(args.gui, backend)
    101

/usr/local/lib/python3.7/site-packages/execnb/shell.py in enable_matplotlib(self, gui)
     91     def enable_matplotlib(self, gui=None):
     92         "Enable `matplotlib` in a nested shell"
---> 93         from matplotlib_inline.backend_inline import configure_inline_support
     94         configure_inline_support.current_backend = 'unset'
     95         return super().enable_matplotlib(gui)

ModuleNotFoundError: No module named 'matplotlib_inline'

cc @seeM

@seeM
Copy link
Contributor

seeM commented Aug 1, 2022

I'm unable to reproduce this. seeM@662969d adds a notebook with the mentioned lines to a test branch. All tests pass in CI for that commit. cc @bkowshik @jph00

@jph00 jph00 closed this as completed Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants