home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 1536707912

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
1536707912 I_kwDOAMm_X85bmE1I 7448 REPL not working on xarray.dev 686570 closed 0 13301940   1 2023-01-17T16:46:31Z 2023-01-17T20:21:33Z 2023-01-17T20:21:33Z NONE      

What happened?

The "try it" REPL did not property load at https://xarray.dev/#repl There was a problem with import matplotlib

What did you expect to happen?

The automatically populated first block of the pyolite REPL would load and run without errors

Minimal Complete Verifiable Example

Python Open https://xarray.dev/#repl and watch errors.

MVCE confirmation

  • [x] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
  • [x] Complete example — the example is self-contained, including all data and the text of any traceback.
  • [x] Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
  • [X] New issue — a search of GitHub Issues suggests this is not a duplicate.

Relevant log output

```Python """

The next two commands are only needed on this webpage

Please do not try to run them outside of this webpage, otherwise you will get an error

"""

import micropip

await micropip.install(['xarray'])

​

Import packages

import xarray as xr

import numpy as np

import pandas as pd

%matplotlib inline


ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 12 10 import numpy as np 11 import pandas as pd ---> 12 get_ipython().run_line_magic('matplotlib', 'inline')

File /lib/python3.10/site-packages/IPython/core/interactiveshell.py:2369, in InteractiveShell.run_line_magic(self, magic_name, line, _stack_depth) 2367 kwargs['local_ns'] = self.get_local_scope(stack_depth) 2368 with self.builtin_trap: -> 2369 result = fn(args, *kwargs) 2370 return result

File /lib/python3.10/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 /lib/python3.10/site-packages/IPython/core/interactiveshell.py:3522, in InteractiveShell.enable_matplotlib(self, gui) 3501 def enable_matplotlib(self, gui=None): 3502 """Enable interactive matplotlib and inline figure support. 3503 3504 This takes the following steps: (...) 3520 display figures inline. 3521 """ -> 3522 from matplotlib_inline.backend_inline import configure_inline_support 3524 from IPython.core import pylabtools as pt 3525 gui, backend = pt.find_gui_and_backend(gui, self.pylab_gui_select)

File /lib/python3.10/site-packages/matplotlib_inline/init.py:1 ----> 1 from . import backend_inline, config # noqa 2 version = "0.1.6" # noqa

File /lib/python3.10/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: The module 'matplotlib' is included in the Pyodide distribution, but it is not installed. You can install it by calling: await micropip.install("matplotlib") in Python, or await pyodide.loadPackage("matplotlib") in JavaScript See https://pyodide.org/en/stable/usage/loading-packages.html for more details. ```

Anything else we need to know?

If 'matplotlib' is added to the list of libraries to be installed with micropip, it works fine: ```python """ The next two commands are only needed on this webpage Please do not try to run them outside of this webpage, otherwise you will get an error """ import micropip await micropip.install(['xarray', 'matplotlib'])

Import packages

import xarray as xr import numpy as np import pandas as pd %matplotlib inline python xr

<module 'xarray' from '/lib/python3.10/site-packages/xarray/__init__.py'> ```

Environment

INSTALLED VERSIONS ------------------ commit: None python: 3.10.2 (main, Jan 3 2023, 11:46:47) [Clang 16.0.0 (https://github.com/llvm/llvm-project dee009d3b5c71a340eb4ebb3cfb4 python-bits: 32 OS: Emscripten OS-release: 3.1.27 machine: wasm32 processor: byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: None libnetcdf: None xarray: 2022.12.0 pandas: 1.5.2 numpy: 1.23.5 scipy: None netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: None nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: None distributed: None matplotlib: 3.5.2 cartopy: None seaborn: None numbagg: None fsspec: None cupy: None pint: None sparse: None flox: None numpy_groupies: None setuptools: 65.6.3 pip: None conda: None pytest: None mypy: None IPython: 8.8.0 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7448/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.877ms · About: xarray-datasette