# auto compeletion in vs code

**URL:** https://discourse.vtk.org/t/auto-compeletion-in-vs-code/7728
**Category:** Support
**Created:** [January 27, 2022, 1:45pm UTC](https://discourse.vtk.org/t/auto-compeletion-in-vs-code/7728 "2022-01-27T13:45:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![RAUMIK\_RANA](https://discourse.vtk.org/user_avatar/discourse.vtk.org/raumik_rana/32/3338_2.png) [@RAUMIK\_RANA](https://discourse.vtk.org/u/RAUMIK_RANA)
#### Post date: [January 27, 2022, 1:45pm UTC](https://discourse.vtk.org/t/auto-compeletion-in-vs-code/7728/1 "2022-01-27T13:45:04Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [January 27, 2022, 3:35pm UTC](https://discourse.vtk.org/t/auto-compeletion-in-vs-code/7728/2 "2022-01-27T15:35:12Z")

</div>

> [@RAUMIK\_RANA](#):
>
> Proper way to import vtk

`from vtkmodules import MODULENAME`

> [@RAUMIK\_RANA](#):
>
> is there any other requirement for auto completion of vtk classes

Completion (`.pyi`) files will be in 9.2.

Cc: @dgobbi

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [January 27, 2022, 3:47pm UTC](https://discourse.vtk.org/t/auto-compeletion-in-vs-code/7728/3 "2022-01-27T15:47:57Z")

</div>

@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](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](https://vtk.org/doc/nightly/html/md__builds_gitlab_kitware_sciviz_ci_Documentation_Doxygen_PythonWrappers.html#experimental-features).

---

<div class="post-metadata">

### Author: ![loic.tetrel](https://discourse.vtk.org/user_avatar/discourse.vtk.org/loic.tetrel/32/7594_2.png) [@loic.tetrel](https://discourse.vtk.org/u/loic.tetrel)
#### Post date: [August 10, 2023, 3:46pm UTC](https://discourse.vtk.org/t/auto-compeletion-in-vs-code/7728/4 "2023-08-10T15:46:42Z")

</div>

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

 ![image](https://discourse.vtk.org/uploads/default/original/2X/d/d83bbb5c3f68f67c548a096ef7e4fb2bf83c3c01.png)

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [August 11, 2023, 3:25pm UTC](https://discourse.vtk.org/t/auto-compeletion-in-vs-code/7728/5 "2023-08-11T15:25:10Z")

</div>

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