# VTKPython

**URL:** https://discourse.vtk.org/t/vtkpython/5938
**Category:** Support
**Created:** [June 4, 2021, 6:09pm UTC](https://discourse.vtk.org/t/vtkpython/5938 "2021-06-04T18:09:23Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Luis\_Carlos\_Carneiro](https://discourse.vtk.org/user_avatar/discourse.vtk.org/luis_carlos_carneiro/32/1360_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.vtk.org/u/Luis_Carlos_Carneiro)
#### Post date: [June 4, 2021, 6:09pm UTC](https://discourse.vtk.org/t/vtkpython/5938/1 "2021-06-04T18:09:23Z")

</div>

Dear All,

In web-project-templates-master example I am trying to use pycuda package.

Traceback (most recent call last):  
File “./server/vtkpython/vtkw-server.py”, line 48, in   
from vtk\_protocol import VtkCone  
File “/home/luisgo/workspace/basestation/src/novo\_botao/server/vtkpython/vtk\_protocol.py”, line 6, in   
import pycuda.driver as cuda  
ModuleNotFoundError: No module named ‘pycuda’

* * *

The command line is:  
“/home/luisgo/Downloads/ParaView-5.9.0-RC4-MPI-Linux-Python3.8-64bit/bin/pvpython” ./server/vtkpython/vtkw-server.py --content ./dist --port 1234

* * *

How I install pycuda in ParaView Python?

In the normal Python installation the pycuda is working.

Thanks,

Luís Gonçalves

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [June 4, 2021, 7:39pm UTC](https://discourse.vtk.org/t/vtkpython/5938/2 "2021-06-04T19:39:39Z")

</div>

ParaView ships its own build of Python (for a variety of reasons) and doesn’t really support external packages, sorry. You might be able to get it to work with some manual `PYTHONPATH` settings though.

---

<div class="post-metadata">

### Author: ![Luis\_Carlos\_Carneiro](https://discourse.vtk.org/user_avatar/discourse.vtk.org/luis_carlos_carneiro/32/1360_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.vtk.org/u/Luis_Carlos_Carneiro)
#### Post date: [June 4, 2021, 8:15pm UTC](https://discourse.vtk.org/t/vtkpython/5938/3 "2021-06-04T20:15:19Z")

</div>

Can I use normal Python in the above line command instead of ParaView Python?

The command line is:  
“/home/luisgo/Downloads/ParaView-5.9.0-RC4-MPI-Linux-Python3.8-64bit/bin/pvpython” ./server/vtkpython/vtkw-server.py --content ./dist --port 1234

How I run CUDA from server side? Seems that I have to run normal python instead of Paraview Python. Are there some documentation?  
I tried but it do not runs. vtk.web?

---

<div class="post-metadata">

### Author: ![Luis\_Carlos\_Carneiro](https://discourse.vtk.org/user_avatar/discourse.vtk.org/luis_carlos_carneiro/32/1360_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.vtk.org/u/Luis_Carlos_Carneiro)
#### Post date: [June 5, 2021, 9:57am UTC](https://discourse.vtk.org/t/vtkpython/5938/4 "2021-06-05T09:57:48Z")

</div>

Error if normal Python:

Traceback (most recent call last):  
File “./server/vtkpython/vtkw-server.py”, line 43, in   
from vtk.web import wslink as vtk\_wslink  
ModuleNotFoundError: No module named ‘vtk.web’

Must be a solution for this. Must be allowed to use pycuda. Please give a solution.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [June 5, 2021, 11:11am UTC](https://discourse.vtk.org/t/vtkpython/5938/5 "2021-06-05T11:11:53Z")

</div>

Not with the official binaries. You can compile [your own binaries](https://gitlab.kitware.com/paraview/paraview-superbuild) using an external Python which you can then use as you see fit. However, these builds are not generally relocatable (they generally assume that the Python install is in the same absolute path or in the system directory on other machines).

Shipping an embedded Python interpreter while also supporting external Python installations is not something Python makes very easy. If using `PYTHONPATH` or `sys.path` to add search paths to ParaView’s Python doesn’t work, you’ll need to probably build your own.

---

<div class="post-metadata">

### Author: ![Luis\_Carlos\_Carneiro](https://discourse.vtk.org/user_avatar/discourse.vtk.org/luis_carlos_carneiro/32/1360_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.vtk.org/u/Luis_Carlos_Carneiro)
#### Post date: [June 5, 2021, 11:33am UTC](https://discourse.vtk.org/t/vtkpython/5938/6 "2021-06-05T11:33:29Z")

</div>

Not using CUDA from server side is a big shortcoming. I think it must be fixed.

---

<div class="post-metadata">

### Author: ![Luis\_Carlos\_Carneiro](https://discourse.vtk.org/user_avatar/discourse.vtk.org/luis_carlos_carneiro/32/1360_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.vtk.org/u/Luis_Carlos_Carneiro)
#### Post date: [June 5, 2021, 11:56am UTC](https://discourse.vtk.org/t/vtkpython/5938/7 "2021-06-05T11:56:58Z")

</div>

Seems that the user of the example must have more expertise and skills that the developers.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [June 5, 2021, 11:59am UTC](https://discourse.vtk.org/t/vtkpython/5938/8 "2021-06-05T11:59:55Z")

</div>

Note that such binaries will no longer be turn-key. Namely, one would need to get a suitable Python in the environment before launching ParaView. Note that this basically means double clicking on the app on any given platform is not guaranteed to work and instead must be launched from the command line.

Unfortunately, I believe we have higher priority items than this right now.

> [@Luis\_Carlos\_Carneiro](#):
>
> Seems that the user of the example must have more expertise and skills that the developers.

For CUDA, sure, I don’t use it much at all. However, the deployment headaches that come out of bring-your-own-python are not something that can just be ignored. I have no idea how `vtk-web-templates` is set up or where it comes from either. But I doubt they’re using ParaView’s official precompiled binaries.

---

<div class="post-metadata">

### Author: ![Luis\_Carlos\_Carneiro](https://discourse.vtk.org/user_avatar/discourse.vtk.org/luis_carlos_carneiro/32/1360_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.vtk.org/u/Luis_Carlos_Carneiro)
#### Post date: [June 5, 2021, 12:35pm UTC](https://discourse.vtk.org/t/vtkpython/5938/9 "2021-06-05T12:35:00Z")

</div>

Can you please give, if exists, better solution than this?

1st Save data to disk.  
2nd System call normal python with PyCuda code which retrieve data from disk and save results to disk.  
3rd Back to Paraview python retrieve data from disk and go on.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [June 5, 2021, 4:41pm UTC](https://discourse.vtk.org/t/vtkpython/5938/10 "2021-06-05T16:41:19Z")

</div>

I, personally, cannot (I do build system stuff and rarely use paraview itself). Others on the forum may be able to assist though.

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [June 5, 2021, 6:17pm UTC](https://discourse.vtk.org/t/vtkpython/5938/11 "2021-06-05T18:17:20Z")

</div>

Just use a [virtual-env](https://github.com/Kitware/web-project-templates/blob/master/vue-vtkjs-pvw-template/server/pvpython/pvw-server.py#L30-L37) along with ParaView or the latest vtk wheels.

---

<div class="post-metadata">

### Author: ![Luis\_Carlos\_Carneiro](https://discourse.vtk.org/user_avatar/discourse.vtk.org/luis_carlos_carneiro/32/1360_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.vtk.org/u/Luis_Carlos_Carneiro)
#### Post date: [June 5, 2021, 6:34pm UTC](https://discourse.vtk.org/t/vtkpython/5938/12 "2021-06-05T18:34:57Z")

</div>

I have already working the system call from Paraview Python to normal Python. Despite not very elegant.

Can you please be more specific about your solution?

Thanks,

---

<div class="post-metadata">

### Author: ![Luis\_Carlos\_Carneiro](https://discourse.vtk.org/user_avatar/discourse.vtk.org/luis_carlos_carneiro/32/1360_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.vtk.org/u/Luis_Carlos_Carneiro)
#### Post date: [June 5, 2021, 11:19pm UTC](https://discourse.vtk.org/t/vtkpython/5938/13 "2021-06-05T23:19:08Z")

</div>

Dear All,

In the example, I am trying to use the following instruction without success. Does Paraview python not support it?

connectivity3 = vtk.vtkImageConnectivityFilter()

Thanks,

Luís Gonçalves

PS Using ParaView-5.9.0-RC4-MPI-Linux-Python3.8-64bit

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [June 6, 2021, 12:53am UTC](https://discourse.vtk.org/t/vtkpython/5938/14 "2021-06-06T00:53:20Z")

</div>

It does not seem that ParaView would enable that module for any reason, so no it isn’t available inside of the official ParaView binaries.

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [June 7, 2021, 4:44pm UTC](https://discourse.vtk.org/t/vtkpython/5938/15 "2021-06-07T16:44:00Z")

</div>

Since you are not using ParaView and just VTK, you may want to use our latest dev wheels that you can download them from the build steps of our CI with the proper name that match your system [here on the nightly line](https://gitlab.kitware.com/vtk/vtk/-/pipeline_schedules).

---

<div class="post-metadata">

### Author: ![akaszynski](https://discourse.vtk.org/user_avatar/discourse.vtk.org/akaszynski/32/10751_2.png) [@akaszynski](https://discourse.vtk.org/u/akaszynski)
#### Post date: [June 9, 2021, 12:45am UTC](https://discourse.vtk.org/t/vtkpython/5938/16 "2021-06-09T00:45:25Z")

</div>

Thanks for posting the link to the latest dev wheels. It’s great that you guys have pipelines for the latest build of VTK. Can’t wait to see wheels for the next release of VTK!

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [June 9, 2021, 2:52am UTC](https://discourse.vtk.org/t/vtkpython/5938/17 "2021-06-09T02:52:42Z")

</div>

Normally they should be pushed weekly (automatically) to PyPI as `dev` but I think we still have some quirks to fix. (That is the weekly line doing the push to PyPI)

@ben.boeckel might be able to provide some update on the “weekly auto push” status…

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [June 9, 2021, 10:33am UTC](https://discourse.vtk.org/t/vtkpython/5938/18 "2021-06-09T10:33:20Z")

</div>

Still some infrastructure issues. One should be fixed (`trey` has been told to take less work because it just can’t handle 3 builds happening at once in the time limit); looking at Windows.

---

<div class="post-metadata">

### Author: ![akaszynski](https://discourse.vtk.org/user_avatar/discourse.vtk.org/akaszynski/32/10751_2.png) [@akaszynski](https://discourse.vtk.org/u/akaszynski)
#### Post date: [June 11, 2021, 3:25pm UTC](https://discourse.vtk.org/t/vtkpython/5938/19 "2021-06-11T15:25:51Z")

</div>

I’ve downloaded the dev wheels and ran into several issues with picking that led to segmentation faults.

Would it be possible for Kitware to upload wheels I’ve generated for Python 3.9 to PyPi for 9.0.1? I have a feeling that 9.0.2 or 10 will take a while to release and there are a variety of organizations that need Python 3.9 support for VTK on PyPi.

---

<div class="post-metadata">

### Author: ![akaszynski](https://discourse.vtk.org/user_avatar/discourse.vtk.org/akaszynski/32/10751_2.png) [@akaszynski](https://discourse.vtk.org/u/akaszynski)
#### Post date: [June 11, 2021, 3:31pm UTC](https://discourse.vtk.org/t/vtkpython/5938/20 "2021-06-11T15:31:05Z")

</div>

Reason why I ask this is it’s gotten to the point where customers, internal users for large organizations are stuck with Python 3.8, and while I don’t want to, I’m considering making unofficial wheels:

> <https://github.com/pyvista/pyvista/pull/1370>
>
> \### Current Offical Wheel Support
> 
> Not sure if this is the best approach, but …it's probably going to be some time until we have official wheels for Python 3.9+ from VTK, and even though there's work on getting development wheels on PyPi, I've run into a bunch of issues testing out their latest nightly wheels. See:
> https://gitlab.kitware.com/vtk/vtk/-/pipeline\_schedules
> 
> I think part of the issue is simply bugs introduced past 9.0.1.
> 
> 
> \### Unofficial Wheels
> 
> I've been able to doctor some wheels in order to rename them as \`pyvista-vtk\` just to get them on PyPi. For anyone from Kitware who's reading this, we kept the licencing, etc, and really just need a way of hosting wheels on PyPi. I've written emails to Kitware asking to upload the very same wheels to your existing PyPi https://pypi.org/project/vtk/, but I've not gotten any responses. Please email me at akascap@gmail.com and I'll gladly send you over the wheels I built by following https://docs.pyvista.org/extras/building\_vtk.html. Only other modifications was removing duplicate libraries from the wheel to reduce the size by 26 MB.
> 
> Please email me, would love to get wheels out in some way.
> 
> \---
> 
> So far, I've uploaded just Python 3.9 for Linux to test PyPi. Should we decide to support this, we can just upload it to the offical PyPi.
> 
> pip install -i https://test.pypi.org/simple/ pyvista-vtk==9.0.1
> 
> Plan is to add the wheels at https://github.com/pyvista/pyvista/releases/tag/0.31.0 to PyPi. ARM64 architecture is supported by numpy and we should support it as well.
> 
> \### Forseeable Issues
> 
> Since we're still fundamentally still installing \`vtk\` you could run into an issue where you try to install \`pyvista-vtk\` and then \`pyvista-vtk-egl\` to get EGL support and have your original install overwritten. I can't see anyway around this, as we can't really rename the entire \`import vtk\` within pyvista just to support EGL.
> 
> \---
> 
> Would really like any thoughts from @pyvista/developers. It's really annoying not having Python 3.9 support.

Would rather work with you guys, but PyPi VTK Python 3.9 is hindering our adoption of not just pyvista, but anything that’s using pyvista (all of which are using VTK under the hood). I love VTK and really want to expand its adoption.

[Next page](https://discourse.vtk.org/t/vtkpython/5938.md?page=2)
