# No module named 'vtkCommonCorePython' - import vtk

**URL:** https://discourse.vtk.org/t/no-module-named-vtkcommoncorepython-import-vtk/7039
**Category:** Support
**Created:** [November 1, 2021, 9:55pm UTC](https://discourse.vtk.org/t/no-module-named-vtkcommoncorepython-import-vtk/7039 "2021-11-01T21:55:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![BrazilForever11](https://discourse.vtk.org/user_avatar/discourse.vtk.org/brazilforever11/32/4148_2.png) [@BrazilForever11](https://discourse.vtk.org/u/BrazilForever11)
#### Post date: [November 1, 2021, 9:55pm UTC](https://discourse.vtk.org/t/no-module-named-vtkcommoncorepython-import-vtk/7039/1 "2021-11-01T21:55:24Z")

</div>

I am on Windows 10, Python 3.7.11, conda 4.10.3.  
I ran both conda install vtk and pip install vtk, and they ran fine.

When I try  
`import vtk`

I get back:

```auto
ImportError Traceback (most recent call last)
D:\user_data\Program_Files\Anaconda3\envs\tensorflow\lib\site-packages\vtkmodules\vtkCommonCore.py in <module>
      4 # use relative import for installed modules
----> 5 from .vtkCommonCorePython import *
      6 except ImportError:

ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

ModuleNotFoundError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_3128/2084281522.py in <module>
----> 1 import vtk

D:\user_data\Program_Files\Anaconda3\envs\tensorflow\lib\site-packages\vtk.py in <module>
     30 all_spec = importlib.util.find_spec('vtkmodules.all')
     31 all_m = importlib.util.module_from_spec(all_spec)
---> 32 all_spec.loader.exec_module(all_m)
     33 
     34 # import vtkmodules

D:\user_data\Program_Files\Anaconda3\envs\tensorflow\lib\site-packages\vtkmodules\all.py in <module>
      5 
      6 # --------------------------------------
----> 7 from .vtkCommonCore import *
      8 from .vtkCommonMath import *
      9 from .vtkCommonMisc import *

D:\user_data\Program_Files\Anaconda3\envs\tensorflow\lib\site-packages\vtkmodules\vtkCommonCore.py in <module>
      7 # during build and testing, the modules will be elsewhere,
      8 # e.g. in lib directory or Release/Debug config directories
----> 9 from vtkCommonCorePython import *

ModuleNotFoundError: No module named 'vtkCommonCorePython'

```

Any ideas how to troubleshoot?

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [November 3, 2021, 5:55am UTC](https://discourse.vtk.org/t/no-module-named-vtkcommoncorepython-import-vtk/7039/2 "2021-11-03T05:55:46Z")

</div>

I think you need something like:

```python
from vtkmodules.vtkCommonCorePython import *

```

Try running one of the examples in vtk-examples e.g. [CylinderExample](https://kitware.github.io/vtk-examples/site/Python/GeometricObjects/CylinderExample/). In this example the specific classes are imported along with these two modules which you will usually need to import:

```python
# noinspection PyUnresolvedReferences
import vtkmodules.vtkInteractionStyle
# noinspection PyUnresolvedReferences
import vtkmodules.vtkRenderingOpenGL2

```

A good trick is to replace all your imports initially with:

```auto
import vtkmodules.all as vtk

...
colors = vtk.vtkNamedColors()

```

then run [VTKImportsForPython](https://kitware.github.io/vtk-examples/site/Python/Utilities/VTKImportsForPython/) and add in the generated imports, you will also need to replace `vtk.vtkNamedColors()` with `vtkNamedColors()` so the code would then look something like this:

```auto
from vtkmodules.vtkCommonColor import vtkNamedColors

...
colors = vtkNamedColors()

```
