Render() causes a non responding Visualization Toolkit - Win32OpenGL on Windows

Following this issue I’m trying to render the cone example. The sequence of commands:

from paraview.simple import *
cone = Cone()
Show(cone)
Render()

It opens a nonresponsive window:

which shows non responding in the task manager too:

My version of Python is:

Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] on win32

and I’m on Windows 10 64-bit. I would appreciate if you could help me solve this issue.

P.S.1. I reported an issue here in the ParaView repo, hopefully it will be resolved soon.

P.S.2. I also reported the issue here in the VTK Users mailing list.

P.S.3 I also asked the question here on StackOverflow.

Ok, So far from here I have realised that the issue above seems to be due to the 64bit Python version installed. So I uninstalled it and installed the 32bit version. Now when I try to run the command from paraview.simple import * I get the error:

Error: Could not import vtkCommonComputationalGeometry
Traceback (most recent call last):
File “”, line 1, in
File “C:\Program Files\ParaView 5.4.1-822-g597adef-Qt5-Windows-64bit\bin\Lib\site-packages\paraview\simple.py”, line 41, in
from paraview import servermanager
File “C:\Program Files\ParaView 5.4.1-822-g597adef-Qt5-Windows-64bit\bin\Lib\site-packages\paraview\servermanager.py”, line 53, in
from paraview import vtk
File “C:\Program Files\ParaView 5.4.1-822-g597adef-Qt5-Windows-64bit\bin\Lib\site-packages\paraview\vtk_init_.py”, line 7, in
from paraview.vtk.vtkCommonCore import *
File “C:\Program Files\ParaView 5.4.1-822-g597adef-Qt5-Windows-64bit\bin\Lib\site-packages\paraview\vtk\vtkCommonCore.py”, line 9, in
from vtkCommonCorePython import *
ImportError: No module named vtkCommonCorePython

Which has also been reported here. From here it seems that it can’t find the vtkCommonCorePython which is in the folder:

 C:\Program Files\ParaView 5.4.1-822-g597adef-Qt5-Windows-64bit\bin\Lib\site-packages\vtk

However when adding this path to the PYTHONPATH as described here I get the new error:

ImportError: DLL load failed: %1 is not a valid Win32 application.

The exact error has been also reported here. This post says that this might happen because my ParaView version is 64bit. I looked for a 32 bit version of paraview but didn’t find any :disappointed_relieved:

The render window is not expected to be interactive when using ParaView’s Python scripting. One important exception is if you are executing Python scripts in paraview.exe - in that case the RenderView is interactive.

ParaView and all supporting libraries are 64-bit. It will work only with the 64-bit Python installation. There is no need for 32-bit anything. But as I mentioned here, pvpython.exe may be your best bet.

1 Like

So the non responding window is expected? Doesn’t seem like a normal behaviour to me. It is ok if it not interactive but still you should be able to move the window and resize it …

Using ParaView through Python is usually meant for batch generation of images that are saved to files. For such uses, the window is incidental and disappears when the python executable terminates, so the fact that it is not movable has not been enough of an issue to address. To resize the window, use the Python commands

v = GetActiveView()
v.ViewSize=[500,500] # [width,height]
Render()
1 Like

I tried this on my mac using the pvpython as suggested here . Although it is possible to move the window here, It is non responding here too.

Just use Interact() instead of Render()

eg:

>>> from paraview.simple import *
>>> Cone()
<paraview.servermanager.Cone object at 0x7f30cc989c90>
>>> Show()
<paraview.servermanager.GeometryRepresentation object at 0x7f30cc989d90>
>>> Interact()
3 Likes

Brilliant! I obviously didn’t know about that function. :man_facepalming:

1 Like