question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`pyvista` (`pythreejs` or `ipygany` backend) incompatible with `ipywidgets>7.7.2.`

See original GitHub issue

Describe the bug, what’s wrong, and what you expected.

The jupyter backend pythreejs does not work with the newest release if ipywidgets. No plot is produced

Steps to reproduce the bug.

FROM ubuntu:22.04


WORKDIR /tmp/

# pyvista dependencies from apt
RUN apt-get -qq update && \
    apt-get -y install libxrender-dev libgl1-mesa-dev xvfb python3-pip && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /var/tmp/*

# Install python dependencies
RUN pip3 install --upgrade pip 


# Install components from dolfinx/lab
RUN pip3 install pyvista pythreejs ipygany pyvista jupyterlab && \
    pip3 cache purge && \
    jupyter nbextension enable --py --sys-prefix ipygany


EXPOSE 8888/tcp

ENV SHELL /bin/bash
ENTRYPOINT ["jupyter", "lab", "--ip", "0.0.0.0", "--no-browser", "--allow-root"]

import pyvista as pv

sphere = pv.Sphere(center=(1, 0, 0))
cube = pv.Cube()
pv.set_jupyter_backend("pythreejs")
pl = pv.Plotter()
pl.add_mesh(sphere, color='r')
pl.add_mesh(cube, color='b')
pl.show()

Downgrading ipywidgets resolves the issue.

System Information

--------------------------------------------------------------------------------
  Date: Tue Sep 06 11:23:32 2022 UTC

                OS : Linux
            CPU(s) : 8
           Machine : x86_64
      Architecture : 64bit
               RAM : 15.5 GiB
       Environment : Jupyter
       GPU Details : error

  Python 3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0]

           pyvista : 0.36.1
               vtk : 9.2.0
             numpy : 1.23.2
           imageio : 2.21.2
           appdirs : 1.4.4
            scooby : 0.5.12
        matplotlib : 3.5.3
           IPython : 8.5.0
        jupyterlab : 3.4.6
         pythreejs : Version unknown
--------------------------------------------------------------------------------

Screenshots

ipywidgets

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:4
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
akaszynskicommented, Sep 26, 2022

Would it be better to raise this in https://github.com/jupyter-widgets/pythreejs? I’m guessing that the issue is actually with pythreejs and not pyvista.

@banesullivan, this really emphasises the need to have a solid jupyter widget from either Kitware or PyVista.

0reactions
banesullivancommented, Sep 27, 2022

I just pushed out ipyvktlink==0.2.3 which pins ipywidgets to ~=7.7 to help mitigate these issues (at least for ipyvtklink)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using ipygany with PyVista
The ipygany jupyterlab plotting backend is a powerful module that enables pure plotting that leverages threejs through the pythreejs widget.
Read more >
jupyter widget problem: pythreejs #1698 - pyvista ... - GitHub
I try a simple example of pyvista in a jupyter notebook, ... there is some error happening with that specific jupyter backend, ipygany...
Read more >
Plot error using pyvista - I/O - FEniCS Project
However, the error still exists when using ipygany and pythreejs . I really don't know how to fix it. Has anyone encountered this...
Read more >
Why jupyter notebook or lab doesn't show an interactive ...
I am unable to interact with pyvista plots either on jupyter ... but only if I set the backend to ipyvtklink ; pythreejs...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found