Error while adding missing .ddl files to pvpython

Hi all,

As an example, I’m using vtk as a server, paraview web as a client and running them with pvpython of Paraview 5.9.0.I want to be able to use vtkImageViewer2. For some reason, vtkInteractionImage is not included in the bin/Lib/site-package/vtkmodules of Paraview 5.9.0 Therefore the vtkmodules/all.py is not recognizing vtkmodules.vtkInteractionImage.vtkImageViewer2.

Whereas, vtkImageViewer2 is present in a normal vtk 9.0.3 version installed in an anaconda environment.

I want to be able to use vtkImageViewer2 with the vtkmodules inside bin/Lib/site-package of Paraview 5.9.0. How would I include the vtkInteractionImage .dll files.

What I’ve tried so far…
Copy pasting the .dll file and .pyd file of vtkInteractionImage from the vtkmodules in the anaconda environment to the bin/Lib/site-package/vtkmodules of Paraview 5.9.0 and adding this line, “from .vtkInteractionImage import *” in the all.py module of bin/Lib/site-package/vtkmodules of Paraview 5.9.0. But, still I’m getting an error like,
“ImportError: DLL load failed while importing vtkInteractionImage: The specified module could not be found.”

Below are the images for your reference.

Copied the .dll and .pyd file.

Adding the .vtkinteractionImage import to all.py

adding_an_import

The error message:

What am I missing? Any help on this is highly appreciated. Thanks in advance!

It might be easier to use any pre-release version of vtk instead of ParaView for running your server.

Hi Sebastien,

I tried doing that. I’m so confused. But, I’m facing a lot of issues. For eg: I used flask as a web server instead of pvpython. And pip install vtk instead of the vtk in paraview. The problem is flask’s app.run() and wslink.server’s start_server() are both blocking calls. I guess I have to do some multi-threading. But, I’m not sure. How is pvpython handling it? Also I’m confused. If I use flask, for the requests, say you visit a url, like http://localhost:5000 after that you create a websocket connection, then I guess I’ll have to use flask socket io instead of ws link right? If I replace wslink, then I won’t be able to use the exportRPC for easy callbacks. That’s why I thought adding the required .dll files would be the best way.

Any direction on any of these 2 approaches is appreciated.
Thank you.

What do you serve with Flask? Do you need to share memory with the VTK (wslink) that get used by the client?

If you can, keep the 2 process separate. Ideally you want to use a launcher to start 1 wslink process per client. And you can use your flask for serving the static content to the client along with other dynamic resources.

To answer your questions…
What do you server with Flask? - just static files like html and js
Do you need to share memory with wslink that is being used by client? - yes
Basically, just like this example here, paraviewweb-examples/multiviews at master · Kitware/paraviewweb-examples · GitHub
Have the exact same tech stack and only replace pvpython with flask as server.

Okay, i’ll try the way you suggested. What you’re suggesting is something like this? ParaView Lite and modify to fit my requirement?