# Python/VTK import style

**URL:** https://discourse.vtk.org/t/python-vtk-import-style/13258
**Category:** Support
**Created:** [February 5, 2024, 1:48pm UTC](https://discourse.vtk.org/t/python-vtk-import-style/13258 "2024-02-05T13:48:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rexthor](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rexthor/32/6481_2.png) [@rexthor](https://discourse.vtk.org/u/rexthor)
#### Post date: [February 5, 2024, 1:48pm UTC](https://discourse.vtk.org/t/python-vtk-import-style/13258/1 "2024-02-05T13:48:12Z")

</div>

I may be answering my own question to some extent, but I’m used to importing VTK functionality into Python as:

```python
import vtk

```

however I see a lot of examples and test code using import lines like this:

```python
from vtkmodules.vtkCommonCore import vtkPoints

```

I do see [this page](https://docs.vtk.org/en/latest/api/python/vtkmodules/vtkmodules.html) indicating that it is experimental API, but [this page](https://docs.vtk.org/en/latest/api/cmake/ModuleSystem.html) looks like I should start migrating my code to use it … will `import vtk` be deprecated any time soon?

---

<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: [February 6, 2024, 1:57pm UTC](https://discourse.vtk.org/t/python-vtk-import-style/13258/2 "2024-02-06T13:57:38Z")

</div>

> [@rexthor](#):
>
> will `import vtk` be deprecated any time soon?

Unlikely; it is far too wide-spread to start kicking out warnings at this point. The main benefit is that `vtkmodules` imports way faster because you import only what is needed.

---

<div class="post-metadata">

### Author: ![rexthor](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rexthor/32/6481_2.png) [@rexthor](https://discourse.vtk.org/u/rexthor)
#### Post date: [February 8, 2024, 2:28pm UTC](https://discourse.vtk.org/t/python-vtk-import-style/13258/3 "2024-02-08T14:28:55Z")

</div>

To future readers, if you are trying to migrate to the `from vtkmodules` style, you can figure out what module a vtk object is in using Python’s online help:

```python
>>> help(vtk.vtkCellArray)

Help on class vtkCellArray in module vtkmodules.vtkCommonDataModel:
# ... etc. ...

```
