`pyvista` (`pythreejs` or `ipygany` backend) incompatible with `ipywidgets>7.7.2.`
See original GitHub issueDescribe 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
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:7 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 notpyvista
.@banesullivan, this really emphasises the need to have a solid jupyter widget from either Kitware or PyVista.
I just pushed out
ipyvktlink==0.2.3
which pinsipywidgets
to~=7.7
to help mitigate these issues (at least for ipyvtklink)