Looking at https://vtk.org/download/,
there are only wheels for python 3.6 - 3.9. I don’t think python 3.10 is supported, unless Conda is doing something extra…
Actually that is expected as some VTK factories don’t get properly initialized.
You need to do the following imports to properly initialize it. The interactor style is probably not required for that specific example though.
I just followed your steps and the result was the same for me, no window opened and program terminates without error
Although I did receive the following warning in stdout
2022-04-07 09:10:45.648 Python[28107:7375278] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/5z/d1d_q74d1hd653s14vwq9v800000gn/T/org.python.python.savedState
A quick google search shows that this is a common warning when launching a window from python on macos. So it seems that at least there is some indication that the program is trying to launch a window.
What version of macos are you using? I am on version 12.1, also curious what version @bfosso is using
I am having the same issue with VTK 9.2.20230422/Python 3.8.12/Jupyter-lab 3.2.8/MacOS12.6.3: When running tutorial 1 from jupyterlab, without the interactor, the window will not open on renWin.Render(), even though
print(renWin)
vtkCocoaRenderWindow (0x150617830)
Debug: Off
Modified Time: 1065
Reference Count: 2
Registered Events: (none)
Erase: On
Window Name: Visualization Toolkit - Cocoa #1
Position: (50, 220)
Size: (1500, 1500)
Mapped: 1
ShowWindow: 1
UseOffScreenBuffers: 0
Double Buffered: 1
DPI: 72
TileScale: (1, 1)
TileViewport: (0, 0, 1, 1)
Borders: On
Double Buffer: On
Full Screen: Off
Renderers:
Debug: Off
Modified Time: 195
Reference Count: 1
Registered Events: (none)
Number Of Items: 1
Stereo Capable Window Requested: No
Stereo Render: Off
Point Smoothing: Off
Line Smoothing: Off
Polygon Smoothing: Off
Abort Render: 0
Current Cursor: 0
Desired Update Rate: 0.0001
In Abort Check: 0
NeverRendered: 0
Interactor: 0x15070ec00
Swap Buffers: On
Stereo Type: RedBlue
Number of Layers: 1
AlphaBitPlanes: On
UseSRGBColorSpace: Off
AnaglyphColorSaturation: 0.65
AnaglyphColorMask: 4 , 3
MultiSamples: 0
StencilCapable: False
CocoaManager: 0x6000031b0180
RootWindow (NSWindow): 0x104204b30
WindowId (NSView): 0x1042046c0
ParentId (NSView): 0x0
ContextId: 0x6000031807c0
PixelFormat: 0x6000033b8690
WindowCreated: Yes
ViewCreated: Yes
WantsBestResolution: Yes
When an interactor is added, the window opens, and the keyboard commands work. However, on (q)quite/(e)xit, the render window will stay open even though other cells can now be executed. Mousing over it will show the spinning wheel cursor. While minimization (yellow button) works, the red one does not. The only way to get rid of the window seems to be to restart the kernel.
iren.GetRenderWindow().Finalize()
iren.TerminateApp()
del renWin, iren
executes w/o error, and renWin and iren are deleted, but the window remains open.