# VTK CMake Python Does Not Link or Include \`api-ms-win-core\` Libraries

**URL:** https://discourse.vtk.org/t/vtk-cmake-python-does-not-link-or-include-api-ms-win-core-libraries/6458
**Category:** Support
**Created:** [August 25, 2021, 8:01am UTC](https://discourse.vtk.org/t/vtk-cmake-python-does-not-link-or-include-api-ms-win-core-libraries/6458 "2021-08-25T08:01:35Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Adam\_Hendry](https://discourse.vtk.org/user_avatar/discourse.vtk.org/adam_hendry/32/5571_2.png) [@Adam\_Hendry](https://discourse.vtk.org/u/Adam_Hendry)
#### Post date: [August 25, 2021, 8:01am UTC](https://discourse.vtk.org/t/vtk-cmake-python-does-not-link-or-include-api-ms-win-core-libraries/6458/1 "2021-08-25T08:01:35Z")

</div>

VTK compiles and installs perfectly fine, but after adding the built files to my Python directory, importing `vtk` gives a `DLL` error:

```python
Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import vtk
Traceback (most recent call last):
  File "C:\Program Files\Python38\lib\site-packages\vtkmodules\ __init__.py", line 13, in <module>
    from . import vtkCommonCore
ImportError: DLL load failed while importing vtkCommonCore: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\Python38\lib\site-packages\vtk.py", line 30, in <module>
    all_m = importlib.import_module('vtkmodules.all')
  File "C:\Program Files\Python38\lib\importlib\ __init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Program Files\Python38\lib\site-packages\vtkmodules\ __init__.py", line 15, in <module>
    import _vtkmodules_static
ModuleNotFoundError: No module named '_vtkmodules_static'
>>>

```

I believe this might be due to the fact that the `api-ms-win-core` libraries are not included in the build. Using Dependency Walker on `vtkCommonCore-9.0.dll` shows many missing DLLs:

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

Additionally, the same exact build installed in Intel Python does not have this error:

```python
Python 3.7.10 (default, Jun 3 2021, 22:08:24) [MSC v.1916 64 bit (AMD64)] :: Intel Corporation on win32

Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation

Type "help", "copyright", "credits" or "license" for more information.
Intel(R) Distribution for Python is brought to you by Intel Corporation.
Please check out: https://software.intel.com/en-us/python-distribution
>>> import vtk
>>>

```

How can I fix this issue?

---

<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: [August 25, 2021, 12:50pm UTC](https://discourse.vtk.org/t/vtk-cmake-python-does-not-link-or-include-api-ms-win-core-libraries/6458/2 "2021-08-25T12:50:22Z")

</div>

I’ve replied in [the issue](https://gitlab.kitware.com/vtk/vtk/-/issues/18284#note_1005574).
