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.

Ipyvtk_simple is not ipyvtk_link in 3D notebook viewer

See original GitHub issue

Describe the bug

I am attempting to use the 3D backend notebook viewer for plotting an ecog brain. I get the following error:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
~/Documents/sickkids/.venv/lib/python3.8/site-packages/pyvista/plotting/plotting.py in show(self, title, window_size, interactive, auto_close, interactive_update, full_screen, screenshot, return_img, cpos, use_ipyvtk, **kwargs)
   4323             try:
-> 4324                 from ipyvtk_simple.viewer import ViewInteractiveWidget
   4325             except ImportError:

ModuleNotFoundError: No module named 'ipyvtk_simple'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-20-ea5cd7c5fb7d> in <module>
----> 1 fig = plot_alignment(
      2     raw.info,
      3     subject="E1",
      4     subjects_dir=subjects_dir,
      5     surfaces=["pial"],

<decorator-gen-151> in plot_alignment(info, trans, subject, subjects_dir, surfaces, coord_frame, meg, eeg, fwd, dig, ecog, src, mri_fiducials, bem, seeg, fnirs, show_axes, dbs, fig, interaction, verbose)

~/Documents/sickkids/.venv/lib/python3.8/site-packages/mne/viz/_3d.py in plot_alignment(***failed resolving arguments***)
   1098     renderer.set_camera(azimuth=90, elevation=90,
   1099                         distance=0.6, focalpoint=(0., 0., 0.))
-> 1100     renderer.show()
   1101     return renderer.scene()
   1102 

~/Documents/sickkids/.venv/lib/python3.8/site-packages/mne/viz/backends/_notebook.py in show(self)
    360         # viewer
    361         if LooseVersion(pyvista.__version__) < LooseVersion('0.30'):
--> 362             viewer = self.plotter.show(
    363                 use_ipyvtk=True, return_viewer=True)
    364         else:  # pyvista>=0.30.0

~/Documents/sickkids/.venv/lib/python3.8/site-packages/pyvista/plotting/plotting.py in show(self, title, window_size, interactive, auto_close, interactive_update, full_screen, screenshot, return_img, cpos, use_ipyvtk, **kwargs)
   4324                 from ipyvtk_simple.viewer import ViewInteractiveWidget
   4325             except ImportError:
-> 4326                 raise ImportError('Please install `ipyvtk_simple` to use this feature:'
   4327                                   '\thttps://github.com/Kitware/ipyvtk-simple')
   4328             # Have to leave the Plotter open for the widget to use

ImportError: Please install `ipyvtk_simple` to use this feature:	https://github.com/Kitware/ipyvtk-simple

However, this is because ipyvtk_simple is now named… ipyvtk-link 😦

Steps to reproduce

Set mne.viz.set_3d_backend("notebook") and then run plot_ecog.py example.

Additional information

Platform:      macOS-10.16-x86_64-i386-64bit
Python:        3.8.6 | packaged by conda-forge | (default, Jan 25 2021, 23:22:12)  [Clang 11.0.1 ]
Executable:    /Users/adam2392/Documents/sickkids/.venv/bin/python
CPU:           i386: 8 cores
Memory:        Unavailable (requires "psutil" package)
mne:           0.24.dev0
numpy:         1.20.1 {blas=openblas, lapack=openblas}
scipy:         1.6.0
matplotlib:    3.3.4 {backend=agg}

sklearn:       0.24.1
numba:         0.52.0
nibabel:       3.2.1
nilearn:       Not found
dipy:          Not found
cupy:          Not found
pandas:        1.2.2
mayavi:        Not found
pyvista:       0.28.1 {pyvistaqt=0.4.0, OpenGL 4.1 ATI-4.4.17 via AMD Radeon Pro 560 OpenGL Engine}
vtk:           9.0.1
PyQt5:         5.15.2

Also ran w/ mne==0.23

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
adam2392commented, May 21, 2021

Done!

1reaction
adam2392commented, May 13, 2021

Oh just kidding, I guess maybe my ipyvklink isn’t installing properly…

from running pip install ipytklink

  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: /home/adam2392/Documents/sickkids/.venv/bin/python3.8 /home/adam2392/Documents/sickkids/.venv/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpicomhibk
         cwd: /tmp/pip-install-zepgf25i/orjson
    Complete output (11 lines):
    💥 maturin failed
      Caused by: Cargo metadata failed. Does your crate compile with `cargo build`?
      Caused by: `cargo metadata` exited with an error: error: failed to run `rustc` to learn about target-specific information
    
    Caused by:
      process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -Z mutable-noalias=yes -C target-feature=+sse2 --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1)
      --- stderr
      error: the option `Z` is only accepted on the nightly compiler
    Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/tmp/pip-install-zepgf25i/orjson/pip-wheel-metadata', '--interpreter', '/home/adam2392/Documents/sickkids/.venv/bin/python3.8', '--manylinux=off', '--strip=on']' returned non-zero exit status 1.
    Checking for Rust toolchain....
    Running `maturin pep517 write-dist-info --metadata-directory /tmp/pip-install-zepgf25i/orjson/pip-wheel-metadata --interpreter /home/adam2392/Documents/sickkids/.venv/bin/python3.8 --manylinux=off --strip=on`
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/adam2392/Documents/sickkids/.venv/bin/python3.8 /home/adam2392/Documents/sickkids/.venv/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpicomhibk Check the logs for full command output.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Kitware/ipyvtklink: minimalist ipywidget to interface ... - GitHub
A Docker image is prebuilt and hosted in the ipyvtklink repository's packages. and open the vtk. ipynb notebook.
Read more >
Jupyter Notebook Plotting — PyVista 0.37.0 documentation
At the moment, itkwidgets and ipyvtklink are incompatible with Jupyterlab 3, and will result in a “Error displaying widget: model not found” message...
Read more >
Plots not showing in Jupyter notebook - python - Stack Overflow
If you are working with a Jupyter Notebook then you can add the following line to the top cell where you call all...
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