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.

vtkPolyData.ipynb example doesn't work in Jupyter Lab

See original GitHub issue

The example at https://github.com/InsightSoftwareConsortium/itkwidgets/blob/master/examples/vtkPolyData.ipynb doesn’t seem to actually bring up the widget in Jupyter Lab.

For reference here is my environment:

$ conda create -n sw python vtk matplotlib jupyterlab itkwidget
s                                                                                   
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/scopatz/miniconda/envs/sw

  added / updated specs:
    - itkwidgets
    - jupyterlab
    - matplotlib
    - python
    - vtk


The following NEW packages will be INSTALLED:

  _libgcc_mutex      conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge
  _openmp_mutex      conda-forge/linux-64::_openmp_mutex-4.5-1_llvm
  attrs              conda-forge/noarch::attrs-19.3.0-py_0
  backcall           conda-forge/noarch::backcall-0.1.0-py_0
  bleach             conda-forge/noarch::bleach-3.1.4-pyh9f0ad1d_0
  bzip2              conda-forge/linux-64::bzip2-1.0.8-h516909a_2
  ca-certificates    conda-forge/linux-64::ca-certificates-2019.11.28-hecc5488_0
  certifi            conda-forge/linux-64::certifi-2019.11.28-py38h32f6830_1
  cffi               conda-forge/linux-64::cffi-1.14.0-py38hd463f26_0
  chardet            conda-forge/linux-64::chardet-3.0.4-py38h32f6830_1006
  colorcet           conda-forge/noarch::colorcet-2.0.1-py_0
  cryptography       conda-forge/linux-64::cryptography-2.8-py38h766eaa4_2
  curl               conda-forge/linux-64::curl-7.68.0-hf8cf82a_0
  cycler             conda-forge/noarch::cycler-0.10.0-py_2
  dbus               conda-forge/linux-64::dbus-1.13.6-he372182_0
  decorator          conda-forge/noarch::decorator-4.4.2-py_0
  defusedxml         conda-forge/noarch::defusedxml-0.6.0-py_0
  entrypoints        conda-forge/linux-64::entrypoints-0.3-py38h32f6830_1001
  expat              conda-forge/linux-64::expat-2.2.9-he1b5a44_2
  fontconfig         conda-forge/linux-64::fontconfig-2.13.1-h86ecdb6_1001
  freetype           conda-forge/linux-64::freetype-2.10.1-he06d7ca_0
  future             conda-forge/linux-64::future-0.18.2-py38h32f6830_1
  gettext            conda-forge/linux-64::gettext-0.19.8.1-hc5be6a0_1002
  glib               conda-forge/linux-64::glib-2.58.3-py38h73cb85d_1003
  gst-plugins-base   conda-forge/linux-64::gst-plugins-base-1.14.5-h0935bb2_2
  gstreamer          conda-forge/linux-64::gstreamer-1.14.5-h36ae1b5_2
  hdf4               conda-forge/linux-64::hdf4-4.2.13-hf30be14_1003
  hdf5               conda-forge/linux-64::hdf5-1.10.5-nompi_h3c11f04_1104
  icu                conda-forge/linux-64::icu-64.2-he1b5a44_1
  idna               conda-forge/noarch::idna-2.9-py_1
  importlib-metadata conda-forge/linux-64::importlib-metadata-1.5.2-py38h32f6830_0
  importlib_metadata conda-forge/noarch::importlib_metadata-1.5.2-0
  ipydatawidgets     conda-forge/noarch::ipydatawidgets-4.0.1-py_0
  ipykernel          conda-forge/linux-64::ipykernel-5.2.0-py38h23f93f0_1
  ipympl             conda-forge/noarch::ipympl-0.5.6-pyh8c360ce_0
  ipyscales          conda-forge/noarch::ipyscales-0.4.0-py_1
  ipython            conda-forge/linux-64::ipython-7.13.0-py38h32f6830_2
  ipython_genutils   conda-forge/noarch::ipython_genutils-0.2.0-py_1
  ipywidgets         conda-forge/noarch::ipywidgets-7.5.1-py_0
  itk                conda-forge/linux-64::itk-5.0.1-py38_1
  itkwidgets         conda-forge/linux-64::itkwidgets-0.26.1-py38h32f6830_0
  jedi               conda-forge/linux-64::jedi-0.16.0-py38h32f6830_1
  jinja2             conda-forge/noarch::jinja2-2.11.1-py_0
  jpeg               conda-forge/linux-64::jpeg-9c-h14c3975_1001
  json5              conda-forge/noarch::json5-0.9.0-py_0
  jsoncpp            conda-forge/linux-64::jsoncpp-1.8.4-hc9558a2_1002
  jsonschema         conda-forge/linux-64::jsonschema-3.2.0-py38h32f6830_1
  jupyter_client     conda-forge/noarch::jupyter_client-6.1.2-py_0
  jupyter_core       conda-forge/linux-64::jupyter_core-4.6.3-py38h32f6830_1
  jupyterlab         conda-forge/noarch::jupyterlab-2.0.1-py_0
  jupyterlab_server  conda-forge/noarch::jupyterlab_server-1.0.7-py_0
  kiwisolver         conda-forge/linux-64::kiwisolver-1.1.0-py38hbf85e49_1
  krb5               conda-forge/linux-64::krb5-1.16.4-h2fd8d38_0
  ld_impl_linux-64   conda-forge/linux-64::ld_impl_linux-64-2.34-h53a641e_0
  libblas            conda-forge/linux-64::libblas-3.8.0-16_openblas
  libcblas           conda-forge/linux-64::libcblas-3.8.0-16_openblas
  libclang           conda-forge/linux-64::libclang-9.0.1-default_hde54327_0
  libcurl            conda-forge/linux-64::libcurl-7.68.0-hda55be3_0
  libedit            conda-forge/linux-64::libedit-3.1.20170329-hf8c457e_1001
  libffi             conda-forge/linux-64::libffi-3.2.1-he1b5a44_1007
  libgcc-ng          conda-forge/linux-64::libgcc-ng-9.2.0-h24d8f2e_2
  libgfortran-ng     conda-forge/linux-64::libgfortran-ng-7.3.0-hdf63c60_5
  libiconv           conda-forge/linux-64::libiconv-1.15-h516909a_1006
  liblapack          conda-forge/linux-64::liblapack-3.8.0-16_openblas
  libllvm9           conda-forge/linux-64::libllvm9-9.0.1-hc9558a2_0
  libnetcdf          conda-forge/linux-64::libnetcdf-4.7.3-nompi_h9f9fd6a_101
  libopenblas        conda-forge/linux-64::libopenblas-0.3.9-h5ec1e0e_0
  libpng             conda-forge/linux-64::libpng-1.6.37-hed695b0_1
  libsodium          conda-forge/linux-64::libsodium-1.0.17-h516909a_0
  libssh2            conda-forge/linux-64::libssh2-1.8.2-h22169c7_2
  libstdcxx-ng       conda-forge/linux-64::libstdcxx-ng-9.2.0-hdf63c60_2
  libtiff            conda-forge/linux-64::libtiff-4.1.0-hc7e4089_6
  libuuid            conda-forge/linux-64::libuuid-2.32.1-h14c3975_1000
  libwebp-base       conda-forge/linux-64::libwebp-base-1.1.0-h516909a_3
  libxcb             conda-forge/linux-64::libxcb-1.13-h14c3975_1002
  libxkbcommon       conda-forge/linux-64::libxkbcommon-0.10.0-he1b5a44_0
  libxml2            conda-forge/linux-64::libxml2-2.9.10-hee79883_0
  llvm-openmp        conda-forge/linux-64::llvm-openmp-9.0.1-hc9558a2_2
  lz4-c              conda-forge/linux-64::lz4-c-1.8.3-he1b5a44_1001
  markupsafe         conda-forge/linux-64::markupsafe-1.1.1-py38h1e0a361_1
  matplotlib         conda-forge/linux-64::matplotlib-3.2.1-0
  matplotlib-base    conda-forge/linux-64::matplotlib-base-3.2.1-py38h2af1d28_0
  mistune            conda-forge/linux-64::mistune-0.8.4-py38h516909a_1000
  nbconvert          conda-forge/linux-64::nbconvert-5.6.1-py38_0
  nbformat           conda-forge/noarch::nbformat-5.0.4-py_0
  ncurses            conda-forge/linux-64::ncurses-6.1-hf484d3e_1002
  notebook           conda-forge/linux-64::notebook-6.0.3-py38_0
  nspr               conda-forge/linux-64::nspr-4.25-he1b5a44_0
  nss                conda-forge/linux-64::nss-3.47-he751ad9_0
  numpy              conda-forge/linux-64::numpy-1.18.1-py38h8854b6b_1
  openssl            conda-forge/linux-64::openssl-1.1.1e-h516909a_0
  pandoc             conda-forge/linux-64::pandoc-2.9.2-0
  pandocfilters      conda-forge/noarch::pandocfilters-1.4.2-py_1
  param              conda-forge/noarch::param-1.9.3-py_0
  parso              conda-forge/noarch::parso-0.6.2-py_0
  pcre               conda-forge/linux-64::pcre-8.44-he1b5a44_0
  pexpect            conda-forge/linux-64::pexpect-4.8.0-py38h32f6830_1
  pickleshare        conda-forge/linux-64::pickleshare-0.7.5-py38h32f6830_1001
  pip                conda-forge/noarch::pip-20.0.2-py_2
  prometheus_client  conda-forge/noarch::prometheus_client-0.7.1-py_0
  prompt-toolkit     conda-forge/noarch::prompt-toolkit-3.0.5-py_0
  pthread-stubs      conda-forge/linux-64::pthread-stubs-0.4-h14c3975_1001
  ptyprocess         conda-forge/noarch::ptyprocess-0.6.0-py_1001
  pycparser          conda-forge/noarch::pycparser-2.20-py_0
  pyct               conda-forge/noarch::pyct-0.4.6-py_0
  pyct-core          conda-forge/noarch::pyct-core-0.4.6-py_0
  pygments           conda-forge/noarch::pygments-2.6.1-py_0
  pyopenssl          conda-forge/noarch::pyopenssl-19.1.0-py_1
  pyparsing          conda-forge/noarch::pyparsing-2.4.6-py_0
  pyqt               conda-forge/linux-64::pyqt-5.12.3-py38hcca6a23_1
  pyrsistent         conda-forge/linux-64::pyrsistent-0.16.0-py38h1e0a361_0
  pysocks            conda-forge/linux-64::pysocks-1.7.1-py38h32f6830_1
  python             conda-forge/linux-64::python-3.8.2-h8356626_5_cpython
  python-dateutil    conda-forge/noarch::python-dateutil-2.8.1-py_0
  python_abi         conda-forge/linux-64::python_abi-3.8-1_cp38
  pyyaml             conda-forge/linux-64::pyyaml-5.3.1-py38h1e0a361_0
  pyzmq              conda-forge/linux-64::pyzmq-19.0.0-py38ha71036d_1
  qt                 conda-forge/linux-64::qt-5.12.5-hd8c4c69_1
  readline           conda-forge/linux-64::readline-8.0-hf8c457e_0
  requests           conda-forge/noarch::requests-2.23.0-pyh8c360ce_2
  scipy              conda-forge/linux-64::scipy-1.4.1-py38h921218d_0
  send2trash         conda-forge/noarch::send2trash-1.5.0-py_0
  setuptools         conda-forge/linux-64::setuptools-46.1.3-py38h32f6830_0
  six                conda-forge/noarch::six-1.14.0-py_1
  sqlite             conda-forge/linux-64::sqlite-3.30.1-hcee41ef_0
  tbb                conda-forge/linux-64::tbb-2020.1-hc9558a2_0
  terminado          conda-forge/linux-64::terminado-0.8.3-py38h32f6830_1
  testpath           conda-forge/noarch::testpath-0.4.4-py_0
  tk                 conda-forge/linux-64::tk-8.6.10-hed695b0_0
  tornado            conda-forge/linux-64::tornado-6.0.4-py38h1e0a361_1
  traitlets          conda-forge/linux-64::traitlets-4.3.3-py38h32f6830_1
  traittypes         conda-forge/noarch::traittypes-0.2.1-py_1
  urllib3            conda-forge/linux-64::urllib3-1.25.7-py38h32f6830_1
  vtk                conda-forge/linux-64::vtk-8.2.0-py38h1e82295_210
  wcwidth            conda-forge/noarch::wcwidth-0.1.9-pyh9f0ad1d_0
  webencodings       conda-forge/noarch::webencodings-0.5.1-py_1
  wheel              conda-forge/noarch::wheel-0.34.2-py_1
  widgetsnbextension conda-forge/linux-64::widgetsnbextension-3.5.1-py38_0
  xorg-kbproto       conda-forge/linux-64::xorg-kbproto-1.0.7-h14c3975_1002
  xorg-libice        conda-forge/linux-64::xorg-libice-1.0.10-h516909a_0
  xorg-libsm         conda-forge/linux-64::xorg-libsm-1.2.3-h84519dc_1000
  xorg-libx11        conda-forge/linux-64::xorg-libx11-1.6.9-h516909a_0
  xorg-libxau        conda-forge/linux-64::xorg-libxau-1.0.9-h14c3975_0
  xorg-libxdmcp      conda-forge/linux-64::xorg-libxdmcp-1.1.3-h516909a_0
  xorg-libxt         conda-forge/linux-64::xorg-libxt-1.2.0-h516909a_0
  xorg-xproto        conda-forge/linux-64::xorg-xproto-7.0.31-h14c3975_1007
  xz                 conda-forge/linux-64::xz-5.2.4-h516909a_1002
  yaml               conda-forge/linux-64::yaml-0.2.2-h516909a_1
  zeromq             conda-forge/linux-64::zeromq-4.3.2-he1b5a44_2
  zipp               conda-forge/noarch::zipp-3.1.0-py_0
  zlib               conda-forge/linux-64::zlib-1.2.11-h516909a_1006
  zstandard          conda-forge/linux-64::zstandard-0.13.0-py38he1b5a44_0
  zstd               conda-forge/linux-64::zstd-1.4.4-h3b9ef0a_2


Preparing transaction: done
Verifying transaction: done
Executing transaction: - b'Enabling notebook extension jupyter-js-widgets/extension...\n      - Validating: \x1b[32mOK\x1b[0m\n'
done
#
# To activate this environment, use
#
#     $ conda activate sw
#
# To deactivate an active environment, use
#
#     $ conda deactivate

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tassoscommented, Oct 12, 2020

Ok… my bad. I mistyped the argument name in the view call. It should have been:

view(geometries=cone)

instead of

view(geometry=cone)

Funny how you only notice these stuff after you open an issue (I’ve been struggling with this for a couple of days…)

0reactions
tassoscommented, Oct 12, 2020

I opened a new issue, and then noticed there is a very similar problem mentioned here. What was the conclusion eventually?

I am trying to run the example on vtkPolyData, and I am getting a widget with a blank output. I tried zooming in/out, but I do not see anything rendered in the window (you can see the input code and output bellow)

itkwidget_blank

The first part of the example with the bunny is working fine.

I am using Jupyter Lab (2.2.8) and have install itkwidgets (0.32.0) through pip and the jupyter extension through jupyter lab extension manager. Vtk is also installed through pip (9.0.1)

Is there something I am doing wrong?

Read more comments on GitHub >

github_iconTop Results From Across the Web

vtk in jupyter - Web - VTK Discourse
Hi.I've integrated Python vtk in Jupyter lab, however, executing the code opens the renderer window at the server machine not embedded inside Jupyter...
Read more >
IPython Notebook & VTK - PyScience - WordPress.com
IPython Notebook & VTK Summary This post will show the only, currently available, way to integrate those beautiful renderings you might ...
Read more >
ipyvtk-simple - PyPI
An example is given in paraview.ipynb which can be run via: docker build -t ipyvtk_pv -f paraview.dockerfile . docker run -p 8877:8877 ipyvtk_pv...
Read more >
Unable to import a module from Python notebook in Jupyter
The problem is, that I cannot load the module from a notebook that I start using either ipython notebook or jupyter (even though...
Read more >
itkwidgets - PyDigger
Summary, Interactive Jupyter widgets to visualize images, point sets, and meshes in 2D and 3D ; upload_time, 2022-07-11 19:25:35 ; maintainer ; docs_url,...
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