%matplotlib inline
import torch
from d2l import torch as d2l
d2l.set_figsize()
img = d2l.plt.imread("D:\27215\pythonstudy\img")
d2l.plt.imshow(img)
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[3], line 1 ----> 1 get_ipython().run_line_magic('matplotlib', 'inline') 2 import torch 3 from d2l import torch as d2l File ~\anaconda3\envs\tupytorch\Lib\site-packages\IPython\core\interactiveshell.py:2456, in InteractiveShell.run_line_magic(self, magic_name, line, _stack_depth) 2454 kwargs['local_ns'] = self.get_local_scope(stack_depth) 2455 with self.builtin_trap: -> 2456 result = fn(*args, **kwargs) 2458 # The code below prevents the output from being displayed 2459 # when using magics with decorator @output_can_be_silenced 2460 # when the last Python token in the expression is a ';'. 2461 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False): File ~\anaconda3\envs\tupytorch\Lib\site-packages\IPython\core\magics\pylab.py:99, in PylabMagics.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) File ~\anaconda3\envs\tupytorch\Lib\site-packages\IPython\core\interactiveshell.py:3633, in InteractiveShell.enable_matplotlib(self, gui) 3612 def enable_matplotlib(self, gui=None): 3613 """Enable interactive matplotlib and inline figure support. 3614 3615 This takes the following steps: (...) 3631 display figures inline. 3632 """ -> 3633 from matplotlib_inline.backend_inline import configure_inline_support 3635 from IPython.core import pylabtools as pt 3636 gui, backend = pt.find_gui_and_backend(gui, self.pylab_gui_select) File ~\anaconda3\envs\tupytorch\Lib\site-packages\matplotlib_inline\__init__.py:1 ----> 1 from . import backend_inline, config # noqa 2 __version__ = "0.1.6" File ~\anaconda3\envs\tupytorch\Lib\site-packages\matplotlib_inline\backend_inline.py:6 1 """A matplotlib backend for publishing figures via display_data""" 3 # Copyright (c) IPython Development Team. 4 # Distributed under the terms of the BSD 3-Clause License. ----> 6 import matplotlib 7 from matplotlib import colors 8 from matplotlib.backends import backend_agg ModuleNotFoundError: No module named 'matplotlib'