A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.2 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.
Traceback (most recent call last): File "D:\python\Anaconda3\envs\d2l\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "D:\python\Anaconda3\envs\d2l\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\ipykernel_launcher.py", line 18, in <module>
app.launch_new_instance()
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\traitlets\config\application.py", line 1075, in launch_instance
app.start()
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\ipykernel\kernelapp.py", line 739, in start
self.io_loop.start()
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\tornado\platform\asyncio.py", line 211, in start
self.asyncio_loop.run_forever()
File "D:\python\Anaconda3\envs\d2l\lib\asyncio\base_events.py", line 601, in run_forever
self._run_once()
File "D:\python\Anaconda3\envs\d2l\lib\asyncio\base_events.py", line 1905, in _run_once
handle._run()
File "D:\python\Anaconda3\envs\d2l\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\ipykernel\kernelbase.py", line 519, in dispatch_queue
await self.process_one()
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\ipykernel\kernelbase.py", line 508, in process_one
await dispatch(*args)
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\ipykernel\kernelbase.py", line 400, in dispatch_shell
await result
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\ipykernel\ipkernel.py", line 368, in execute_request
await super().execute_request(stream, ident, parent)
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\ipykernel\kernelbase.py", line 767, in execute_request
reply_content = await reply_content
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\ipykernel\ipkernel.py", line 455, in do_execute
res = shell.run_cell(
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\ipykernel\zmqshell.py", line 602, in run_cell
return super().run_cell(*args, **kwargs)
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\IPython\core\interactiveshell.py", line 3048, in run_cell
result = self._run_cell(
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\IPython\core\interactiveshell.py", line 3103, in _run_cell
result = runner(coro)
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\IPython\core\async_helpers.py", line 129, in _pseudo_sync_runner
coro.send(None)
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\IPython\core\interactiveshell.py", line 3308, in run_cell_async
has_raised = await self.run_ast_nodes(code_ast.body, cell_name,
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\IPython\core\interactiveshell.py", line 3490, in run_ast_nodes
if await self.run_code(code, result, async_=asy):
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\IPython\core\interactiveshell.py", line 3550, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "d:\Temp\ipykernel_10160\1106343824.py", line 1, in <module>
get_ipython().run_line_magic('matplotlib', 'inline')
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\IPython\core\interactiveshell.py", line 2456, in run_line_magic
result = fn(*args, **kwargs)
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\IPython\core\magics\pylab.py", line 99, in matplotlib
gui, backend = self.shell.enable_matplotlib(args.gui.lower() if isinstance(args.gui, str) else args.gui)
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\IPython\core\interactiveshell.py", line 3630, in enable_matplotlib
from matplotlib_inline.backend_inline import configure_inline_support
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\matplotlib_inline\__init__.py", line 1, in <module>
from . import backend_inline, config # noqa
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\matplotlib_inline\backend_inline.py", line 6, in <module>
import matplotlib
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\matplotlib\__init__.py", line 161, in <module>
from . import _api, _version, cbook, _docstring, rcsetup
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\matplotlib\rcsetup.py", line 27, in <module>
from matplotlib.colors import Colormap, is_color_like
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\matplotlib\colors.py", line 56, in <module>
from matplotlib import _api, _cm, cbook, scale
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\matplotlib\scale.py", line 22, in <module>
from matplotlib.ticker import (
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\matplotlib\ticker.py", line 138, in <module>
from matplotlib import transforms as mtransforms
File "D:\python\Anaconda3\envs\d2l\lib\site-packages\matplotlib\transforms.py", line 49, in <module>
from matplotlib._path import (
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
AttributeError: _ARRAY_API not found
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[1], line 1
----> 1 get_ipython().run_line_magic('matplotlib', 'inline')
2 import os
3 import pandas as pd
File D:\python\Anaconda3\envs\d2l\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 D:\python\Anaconda3\envs\d2l\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 D:\python\Anaconda3\envs\d2l\lib\site-packages\IPython\core\interactiveshell.py:3630, in InteractiveShell.enable_matplotlib(self, gui)
3609 def enable_matplotlib(self, gui=None):
3610 """Enable interactive matplotlib and inline figure support.
3611
3612 This takes the following steps:
(...)
3628 display figures inline.
3629 """
-> 3630 from matplotlib_inline.backend_inline import configure_inline_support
3632 from IPython.core import pylabtools as pt
3633 gui, backend = pt.find_gui_and_backend(gui, self.pylab_gui_select)
File D:\python\Anaconda3\envs\d2l\lib\site-packages\matplotlib_inline\__init__.py:1
----> 1 from . import backend_inline, config # noqa
3 __version__ = "0.2.1"
5 # we can't ''.join(...) otherwise finding the version number at build time requires
6 # import which introduces IPython and matplotlib at build time, and thus circular
7 # dependencies.
File D:\python\Anaconda3\envs\d2l\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 IPython.core.getipython import get_ipython
8 from IPython.core.interactiveshell import InteractiveShell
File D:\python\Anaconda3\envs\d2l\lib\site-packages\matplotlib\__init__.py:161
157 from packaging.version import parse as parse_version
159 # cbook must import matplotlib only within function
160 # definitions, so it is safe to import from it here.
--> 161 from . import _api, _version, cbook, _docstring, rcsetup
162 from matplotlib.cbook import sanitize_sequence
163 from matplotlib._api import MatplotlibDeprecationWarning
File D:\python\Anaconda3\envs\d2l\lib\site-packages\matplotlib\rcsetup.py:27
25 from matplotlib import _api, cbook
26 from matplotlib.cbook import ls_mapper
---> 27 from matplotlib.colors import Colormap, is_color_like
28 from matplotlib._fontconfig_pattern import parse_fontconfig_pattern
29 from matplotlib._enums import JoinStyle, CapStyle
File D:\python\Anaconda3\envs\d2l\lib\site-packages\matplotlib\colors.py:56
54 import matplotlib as mpl
55 import numpy as np
---> 56 from matplotlib import _api, _cm, cbook, scale
57 from ._color_data import BASE_COLORS, TABLEAU_COLORS, CSS4_COLORS, XKCD_COLORS
60 class _ColorMapping(dict):
File D:\python\Anaconda3\envs\d2l\lib\site-packages\matplotlib\scale.py:22
20 import matplotlib as mpl
21 from matplotlib import _api, _docstring
---> 22 from matplotlib.ticker import (
23 NullFormatter, ScalarFormatter, LogFormatterSciNotation, LogitFormatter,
24 NullLocator, LogLocator, AutoLocator, AutoMinorLocator,
25 SymmetricalLogLocator, AsinhLocator, LogitLocator)
26 from matplotlib.transforms import Transform, IdentityTransform
29 class ScaleBase:
File D:\python\Anaconda3\envs\d2l\lib\site-packages\matplotlib\ticker.py:138
136 import matplotlib as mpl
137 from matplotlib import _api, cbook
--> 138 from matplotlib import transforms as mtransforms
140 _log = logging.getLogger(__name__)
142 __all__ = ('TickHelper', 'Formatter', 'FixedFormatter',
143 'NullFormatter', 'FuncFormatter', 'FormatStrFormatter',
144 'StrMethodFormatter', 'ScalarFormatter', 'LogFormatter',
(...)
150 'MultipleLocator', 'MaxNLocator', 'AutoMinorLocator',
151 'SymmetricalLogLocator', 'AsinhLocator', 'LogitLocator')
File D:\python\Anaconda3\envs\d2l\lib\site-packages\matplotlib\transforms.py:49
46 from numpy.linalg import inv
48 from matplotlib import _api
---> 49 from matplotlib._path import (
50 affine_transform, count_bboxes_overlapping_bbox, update_path_extents)
51 from .path import Path
53 DEBUG = False
ImportError: numpy.core.multiarray failed to import