7

OS: Ubuntu 18.04.6 LTS

Installation:

After running into this issue trying to use pipenv install jupyterlab, I install everything using pip install from within a fresh pipenv shell using Python 3.8.0.

pipenv shell
pip install --upgrade pip
pip install numpy matplotlib jupyterlab ipympl

You can find the Jupyter Lab install doc here.

Running pip list outputs:

Package              Version
-------------------- ---------
anyio                3.5.0
argon2-cffi          21.3.0
argon2-cffi-bindings 21.2.0
asttokens            2.0.5
attrs                21.4.0
Babel                2.9.1
backcall             0.2.0
black                21.12b0
bleach               4.1.0
certifi              2021.10.8
cffi                 1.15.0
charset-normalizer   2.0.10
click                8.0.3
cycler               0.11.0
debugpy              1.5.1
decorator            5.1.1
defusedxml           0.7.1
entrypoints          0.3
executing            0.8.2
fonttools            4.28.5
idna                 3.3
importlib-resources  5.4.0
ipykernel            6.7.0
ipympl               0.8.7
ipython              8.0.1
ipython-genutils     0.2.0
ipywidgets           7.6.5
jedi                 0.18.1
Jinja2               3.0.3
json5                0.9.6
jsonschema           4.4.0
jupyter-client       7.1.1
jupyter-core         4.9.1
jupyter-server       1.13.3
jupyterlab           3.2.8
jupyterlab-pygments  0.1.2
jupyterlab-server    2.10.3
jupyterlab-widgets   1.0.2
kiwisolver           1.3.2
MarkupSafe           2.0.1
matplotlib           3.5.1
matplotlib-inline    0.1.3
mistune              0.8.4
mypy-extensions      0.4.3
nbclassic            0.3.5
nbclient             0.5.10
nbconvert            6.4.0
nbformat             5.1.3
nest-asyncio         1.5.4
notebook             6.4.7
numpy                1.22.1
packaging            21.3
pandocfilters        1.5.0
parso                0.8.3
pathspec             0.9.0
pexpect              4.8.0
pickleshare          0.7.5
Pillow               9.0.0
pip                  21.3.1
pkg_resources        0.0.0
platformdirs         2.4.1
prometheus-client    0.12.0
prompt-toolkit       3.0.24
ptyprocess           0.7.0
pure-eval            0.2.1
pycparser            2.21
Pygments             2.11.2
pyparsing            3.0.7
pyrsistent           0.18.1
python-dateutil      2.8.2
pytz                 2021.3
pyzmq                22.3.0
requests             2.27.1
Send2Trash           1.8.0
setuptools           60.5.0
six                  1.16.0
sniffio              1.2.0
stack-data           0.1.4
terminado            0.12.1
testpath             0.5.0
tomli                1.2.3
tornado              6.1
traitlets            5.1.1
typing_extensions    4.0.1
urllib3              1.26.8
wcwidth              0.2.5
webencodings         0.5.1
websocket-client     1.2.3
wheel                0.37.1
widgetsnbextension   3.5.2
zipp                 3.7.0

Notably jupyterlab==3.2.8, matplotlib==3.5.1 and ipympl==0.8.7 satisfy the version lookup table

Now running jupyter lab --ip 0.0.0.0 --no-browser from inside the pipenv shell (--ip 0.0.0.0 --no-browser because I'm accessing the notebook on a different machine).

Opening a new notebook with the default Python 3 (ipykernel) kernel, creating two cells

from matplotlib import pyplot as plt
import ipympl  # Confirming it is being found by the kernel

%matplotlib widget

# Example found from https://stackoverflow.com/questions/50149562/jupyterlab-interactive-plot

plt.figure()
x = [1,2,3]
y = [4,5,6]
plt.plot(x,y)
plt.show()

Running both cells gives me the common Error message:

Error displaying widget: model not found

What I've already tried:

This question

Where I downgrade:

ipywidgets==7.0.0
ipympl==0.2.1
matplotlib==3.2.0

And install

jupyter labextension install jupyter-matplotlib@0.3.0

No change, same error.


Edit: Using Jupyter Notebook instead of of Jupyter Lab, which means pip install jupyter instead of jupyterlab fixes the issue.

Its what I'll do in lieu of an answer here, but would still like to know if anyone has a straightforward fix for Jupyter Lab.

CSStudent7782
  • 618
  • 1
  • 5
  • 21
  • 1
    dude you made my day! I keep getting "Error displaying widget: model not found" and googled for two whole days with no luck, this is the only solution that worked – yondchang Sep 20 '22 at 02:10

0 Answers0