auto compeletion in vs code

I am new to vtk pyhton.

I installed python 3.9.6 and vtk 9.1.0

there are 2 questions.

  1. Proper way to import vtk
  2. is there any other requirement for auto completion of vtk classes

from vtkmodules import MODULENAME

Completion (.pyi) files will be in 9.2.

Cc: @dgobbi

@RAUMIK_RANA in VTK 9.1, you can install the .pyi autocompletion stubs by running this script: https://gitlab.kitware.com/vtk/vtk/-/blob/master/Utilities/Maintenance/vtk_generate_pyi.py

They haven’t been tested with VS Code yet. So if you can try the script, I’d be glad to hear your results!

For general information on the Python wrappers, see this documentation.

1 Like

Working in vscode with vtk 9.2.20230227 after running vtk_generate_pyi.py as a module

Note that if you install the current VTK release (9.2.6) with pip, the .pyi files are automatically installed.