# Import issue of vmtk libraries

**URL:** <https://discourse.slicer.org/t/import-issue-of-vmtk-libraries/18321>\
**Category:** VMTK\
**Tags:** python\
**Created:** [June 24, 2021, 12:39pm UTC](https://discourse.slicer.org/t/import-issue-of-vmtk-libraries/18321 "2021-06-24T12:39:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bastien\_Saunois](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bastien_saunois/32/8607_2.png) [@Bastien\_Saunois](https://discourse.slicer.org/u/Bastien_Saunois)\
**Post date:** [June 24, 2021, 12:39pm UTC](https://discourse.slicer.org/t/import-issue-of-vmtk-libraries/18321/1 "2021-06-24T12:39:59Z")

</div>

I am trying to re-use the ExtractCenterline.py code.

In the script there are 2 imports that interest me :

- 

```
      import vtkvmtkComputationalGeometryPython as vtkvmtkComputationalGeometry

```

- 

```
      import vtkvmtkMiscPython as vtkvmtkMisc

```

I found the two libraries in the extension folder of vmtkSlicer with a .pyd extension and copied them in my folder project.

Unfortunately, when I launch my python script importing this libraries, it fails to import those.  
Those anyone know how to use this libraries and how to import them?

Bastien

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 24, 2021, 12:55pm UTC](https://discourse.slicer.org/t/import-issue-of-vmtk-libraries/18321/2 "2021-06-24T12:55:31Z")

</div>

What Python environment do you use for your project?

---

<div class="post-metadata">

**Author:** ![Bastien\_Saunois](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bastien_saunois/32/8607_2.png) [@Bastien\_Saunois](https://discourse.slicer.org/u/Bastien_Saunois)\
**Post date:** [June 24, 2021, 12:59pm UTC](https://discourse.slicer.org/t/import-issue-of-vmtk-libraries/18321/3 "2021-06-24T12:59:18Z")

</div>

I am using the anaconda environment with Python 3.8.

---

<div class="post-metadata">

**Author:** ![Bastien\_Saunois](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bastien_saunois/32/8607_2.png) [@Bastien\_Saunois](https://discourse.slicer.org/u/Bastien_Saunois)\
**Post date:** [June 25, 2021, 3:26pm UTC](https://discourse.slicer.org/t/import-issue-of-vmtk-libraries/18321/4 "2021-06-25T15:26:39Z")

</div>

@lassoan I downgraded my version of Python to 3.6 in order to meet the installation of vmtk but I am still not able to import the libraries.

I get the following error :

Traceback (most recent call last):  
File “test.py”, line 16, in   
import vtkvmtkMiscPython as vtkvmtkMisc  
ImportError: DLL load failed: The specified module could not be found.

I am stuck, I don’t understand why it can’t access to the library…

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 25, 2021, 3:56pm UTC](https://discourse.slicer.org/t/import-issue-of-vmtk-libraries/18321/5 "2021-06-25T15:56:07Z")

</div>

You probably need to add the folder that contains the DLLs to you PYTHONPATH environment variable. Also make sure that all other DLLs that VMTK DLLs depend on (such as entire VTK) are available on the path. You can use Dependency Walker to find out what DLLs you need.

---

<div class="post-metadata">

**Author:** ![Bastien\_Saunois](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bastien_saunois/32/8607_2.png) [@Bastien\_Saunois](https://discourse.slicer.org/u/Bastien_Saunois)\
**Post date:** [June 28, 2021, 8:45am UTC](https://discourse.slicer.org/t/import-issue-of-vmtk-libraries/18321/6 "2021-06-28T08:45:54Z")

</div>

Thanks a lot, it worked, I didn’t know about Dependency Walker, it is a very useful tool !
