# Render VTU and VTK files in Jupyter Notebooks

**URL:** https://discourse.paraview.org/t/render-vtu-and-vtk-files-in-jupyter-notebooks/2775
**Category:** Web Support
**Tags:** vtk
**Created:** [October 15, 2019, 8:11pm UTC](https://discourse.paraview.org/t/render-vtu-and-vtk-files-in-jupyter-notebooks/2775 "2019-10-15T20:11:38Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Sirius\_Fuenmayor](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sirius_fuenmayor/32/2103_2.png) [@Sirius\_Fuenmayor](https://discourse.paraview.org/u/Sirius_Fuenmayor)
#### Post date: [October 15, 2019, 8:11pm UTC](https://discourse.paraview.org/t/render-vtu-and-vtk-files-in-jupyter-notebooks/2775/1 "2019-10-15T20:11:38Z")

</div>

Hello, there is a way to render VTU/VTK files on a Jupyter notebook? Or a command to take screenshots of this VTU-VTK files? Support in Google Colaboratory will be great

---

<div class="post-metadata">

### Author: ![NickLeaf](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nickleaf/32/5002_2.png) [@NickLeaf](https://discourse.paraview.org/u/NickLeaf)
#### Post date: [October 15, 2019, 8:42pm UTC](https://discourse.paraview.org/t/render-vtu-and-vtk-files-in-jupyter-notebooks/2775/2 "2019-10-15T20:42:42Z")

</div>

Hi Sirius!

I’ve been working on a project for interactive ParaView within Jupyter, called iPyParaView: [https://github.com/NickLeaf/ipyparaview](https://github.com/NickLeaf/ipyparaview) It was recently open-sourced and is still in an early state (the install process, in particular, needs work). It will eventually slot nicely into the conda / PyViz ecosystem, and might be worth a try to see if it fits your needs.

If you’re keen on a little early adoption, feedback and contributions are more than welcome!

---

<div class="post-metadata">

### Author: ![Sirius\_Fuenmayor](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sirius_fuenmayor/32/2103_2.png) [@Sirius\_Fuenmayor](https://discourse.paraview.org/u/Sirius_Fuenmayor)
#### Post date: [October 15, 2019, 9:18pm UTC](https://discourse.paraview.org/t/render-vtu-and-vtk-files-in-jupyter-notebooks/2775/3 "2019-10-15T21:18:56Z")

</div>

Hi Nick, that is great, I will try it now with Google Colab and give you feedback. I do not think of a better way to show it working that with a functional Jupyter notebook in the cloud. It remains to be seen if paraview could be installed on the virtual machine of Google Colab.

When you say " Note that this requires a pre-existing ParaView installation" it means a “ParaView Server for Headless Machines”? Sorry for my lack of knowledge in these topics

---

<div class="post-metadata">

### Author: ![NickLeaf](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nickleaf/32/5002_2.png) [@NickLeaf](https://discourse.paraview.org/u/NickLeaf)
#### Post date: [October 15, 2019, 9:42pm UTC](https://discourse.paraview.org/t/render-vtu-and-vtk-files-in-jupyter-notebooks/2775/4 "2019-10-15T21:42:00Z")

</div>

No problem! As long as the version of ParaView (and pvpython in particular) runs on the machine, then the widget should work. The headless server version of ParaView isn’t strictly required, but for a VM running in the cloud it’s probably the easiest version to use.

---

<div class="post-metadata">

### Author: ![Sirius\_Fuenmayor](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sirius_fuenmayor/32/2103_2.png) [@Sirius\_Fuenmayor](https://discourse.paraview.org/u/Sirius_Fuenmayor)
#### Post date: [October 15, 2019, 10:45pm UTC](https://discourse.paraview.org/t/render-vtu-and-vtk-files-in-jupyter-notebooks/2775/5 "2019-10-15T22:45:07Z")

</div>

Hi Nick, I am having problems installing your software, I have tried in Google Colab as well as on my ubuntu machine (Ubuntu 19.04 64 bit) and I get the error:

```
Collecting https://github.com/NickLeaf/ipyparaview.git
  Downloading https://github.com/NickLeaf/ipyparaview.git
     | 112kB 71kB/s
  Cannot unpack file /tmp/pip-unpack-1XrKYl/ipyparaview.git (downloaded from /tmp/pip-req-build-Qo3ZAl, content-type: text/html; charset=utf-8); cannot detect archive format
Cannot determine archive format of /tmp/pip-req-build-Qo3ZAl
```

---

<div class="post-metadata">

### Author: ![NickLeaf](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nickleaf/32/5002_2.png) [@NickLeaf](https://discourse.paraview.org/u/NickLeaf)
#### Post date: [October 16, 2019, 4:05pm UTC](https://discourse.paraview.org/t/render-vtu-and-vtk-files-in-jupyter-notebooks/2775/6 "2019-10-16T16:05:51Z")

</div>

It looks like I forgot to update the install instructions in the README when I moved repos. The instructions for installation via pip should be  
`pip install git+https://github.com/NickLeaf/ipyparaview.git`  
Note that this also requires that nodejs be install for npm.

---

<div class="post-metadata">

### Author: ![Sirius\_Fuenmayor](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sirius_fuenmayor/32/2103_2.png) [@Sirius\_Fuenmayor](https://discourse.paraview.org/u/Sirius_Fuenmayor)
#### Post date: [October 17, 2019, 6:10am UTC](https://discourse.paraview.org/t/render-vtu-and-vtk-files-in-jupyter-notebooks/2775/7 "2019-10-17T06:10:29Z")

</div>

thank you Nick I will check

---

<div class="post-metadata">

### Author: ![thewtex](https://discourse.paraview.org/user_avatar/discourse.paraview.org/thewtex/32/854_2.png) [@thewtex](https://discourse.paraview.org/u/thewtex)
#### Post date: [October 21, 2019, 10:01pm UTC](https://discourse.paraview.org/t/render-vtu-and-vtk-files-in-jupyter-notebooks/2775/8 "2019-10-21T22:01:19Z")

</div>

Another option is to use [vtk.js](https://kitware.github.io/vtk-js/index.html)-based rendering via [itkwidgets](https://pypi.org/project/itkwidgets/). Here is [an example](https://github.com/InsightSoftwareConsortium/itkwidgets/blob/master/examples/vtkUnstructuredGrid.ipynb):

 ![vtkUnstructuredGrid%20-%20Jupyter%20Notebook](https://discourse.paraview.org/uploads/default/original/2X/4/4910e4d3a64334157207a615fdd9d277a1d856cf.gif)

And an UnstructuredGrid with [pyvista](http://www.pyvista.org/):

 ![UnstructuredGrid%20-%20Jupyter%20Notebook](https://discourse.paraview.org/uploads/default/original/2X/2/2ab87abc3aafad9d13eb62add37fa7c6f0f74387.gif)

[Notebook](https://github.com/InsightSoftwareConsortium/itkwidgets/blob/master/examples/pyvista.UnstructuredGrid.ipynb)

There is a [known limitation](https://github.com/googlecolab/colabtools/issues/60) in Google Colab for ipywidget-based Jupyter extensions, like itkwidgets and ipyparaview, so your mileage may vary there.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 4, 2020, 4:13am UTC](https://discourse.paraview.org/t/render-vtu-and-vtk-files-in-jupyter-notebooks/2775/9 "2020-02-04T04:13:02Z")

</div>

There is a new Jupyter Kernel for paraview, available here :  
[https://gitlab.kitware.com/paraview/paraviewjupyterkernel](https://gitlab.kitware.com/paraview/paraviewjupyterkernel)

---

<div class="post-metadata">

### Author: ![jfavre](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/b5ac83/32.png) [@jfavre](https://discourse.paraview.org/u/jfavre)
#### Post date: [February 6, 2020, 2:56pm UTC](https://discourse.paraview.org/t/render-vtu-and-vtk-files-in-jupyter-notebooks/2775/10 "2020-02-06T14:56:08Z")

</div>

I have a server-only installation (PARAVIEW\_BUILD\_QT\_GUI=OFF) of ParaView 5.7 and the configuration fails with the error:

Missing required module: ParaView::pqApplicationComponents

Is this something from the GUI? I would not have thought it would be required. We have managed to install and use the first solution by @NickLeaf using the same ParaView installation.

Please advise on how to remove the pqApplicationComponents error.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 7, 2020, 3:18am UTC](https://discourse.paraview.org/t/render-vtu-and-vtk-files-in-jupyter-notebooks/2775/11 "2020-02-07T03:18:23Z")

</div>

@nicolas.vuaille

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [February 7, 2020, 8:43am UTC](https://discourse.paraview.org/t/render-vtu-and-vtk-files-in-jupyter-notebooks/2775/12 "2020-02-07T08:43:10Z")

</div>

**Why we created the paraviewJupyterKernel** (mentioned by Mathieu)

This Jupyter Kernel was designed to be used with the GUI, as an external python shell. It was useful in our use case to keep access to the GUI.

**Why GUI is required and not optional**  
This kernel is an autostart plugin, that can only exists with Qt.

I will update the doc to specify this.
