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.


Luís Gonçalves

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.

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?

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.

Not with the official binaries. You can compile your own binaries 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.

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

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

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.

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.

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.

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

Just use a virtual-env along with ParaView or the latest vtk wheels.

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?


Dear All,

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

connectivity3 = vtk.vtkImageConnectivityFilter()


Luís Gonçalves

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

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.

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.

1 Like

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!

1 Like

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…

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.

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.

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:

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.