# ImportError with Uniform Remesh

**URL:** <https://discourse.slicer.org/t/importerror-with-uniform-remesh/38448>\
**Category:** Support\
**Tags:** surface-toolbox\
**Created:** [September 19, 2024, 7:41pm UTC](https://discourse.slicer.org/t/importerror-with-uniform-remesh/38448 "2024-09-19T19:41:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kucerabi](https://avatars.discourse-cdn.com/v4/letter/k/a88e57/32.png) [@kucerabi](https://discourse.slicer.org/u/kucerabi)\
**Post date:** [September 19, 2024, 7:41pm UTC](https://discourse.slicer.org/t/importerror-with-uniform-remesh/38448/1 "2024-09-19T19:41:14Z")

</div>

Every time I try to use Uniform Remesh in the Surface Toolbox, I get this error:

[Python] Failed to compute output model: DLL load failed while importing \_clustering: The specified module could not be found.  
Traceback (most recent call last):  
File “C:/Users/kucerabi/Desktop/Slicer 5.6.2/bin/…/lib/Slicer-5.6/qt-scripted-modules/SurfaceToolbox.py”, line 278, in onApplyButton  
self.logic.applyFilters(self._parameterNode)  
File “C:/Users/kucerabi/Desktop/Slicer 5.6.2/bin/…/lib/Slicer-5.6/qt-scripted-modules/SurfaceToolbox.py”, line 579, in applyFilters  
SurfaceToolboxLogic.remesh(outputModel, outputModel,  
File “C:/Users/kucerabi/Desktop/Slicer 5.6.2/bin/…/lib/Slicer-5.6/qt-scripted-modules/SurfaceToolbox.py”, line 404, in remesh  
if not SurfaceToolboxLogic.installRemeshPrerequisites():  
File “C:/Users/kucerabi/Desktop/Slicer 5.6.2/bin/…/lib/Slicer-5.6/qt-scripted-modules/SurfaceToolbox.py”, line 387, in installRemeshPrerequisites  
import pyacvd  
File "C:\Users\kucerabi\Desktop\Slicer 5.6.2\lib\Python\Lib\site-packages\pyacvd\_init_.py", line 3, in   
from pyacvd.clustering import Clustering  
File “C:\Users\kucerabi\Desktop\Slicer 5.6.2\lib\Python\Lib\site-packages\pyacvd\clustering.py”, line 16, in   
from pyacvd import \_clustering  
ImportError: DLL load failed while importing \_clustering: The specified module could not be found.

Why am I getting this? What can I do to resolve it?

Thank you!

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [September 19, 2024, 8:20pm UTC](https://discourse.slicer.org/t/importerror-with-uniform-remesh/38448/2 "2024-09-19T20:20:00Z")

</div>

Looks like remeshing python package didn’t install for some reason. Try installing manually and see if you are getting an error  
`pip_install("pyacvd")`

---

<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:** [September 20, 2024, 5:43am UTC](https://discourse.slicer.org/t/importerror-with-uniform-remesh/38448/3 "2024-09-20T05:43:26Z")

</div>

Unfortunately, pyacvd developers broke their package in their 0.3.0 version by adding C code that needs to be compiled and it is only compatible with VTK hosted on PyPI. I’ve [submitted an issue to their tracker](https://github.com/pyvista/pyacvd/issues/56), but since probably they will not fix this for a long time, I’ll add a version restriction to only use pyacvd\<0.3.

In the meantime, you can fix the issue by executing `slicer.util.pip_install("pyacvd<0.3")` in the Slicer Python console.

---

<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:** [September 20, 2024, 6:13pm UTC](https://discourse.slicer.org/t/importerror-with-uniform-remesh/38448/4 "2024-09-20T18:13:14Z")

</div>

I’ve tested this a bit more and on my computer on a fresh Slicer-5.6.2 installation everything works.

Could you please check if this file exists on your computer?

> C:\Users\kucerabi\Desktop\Slicer 5.6.2\lib\Python\Lib\site-packages\pyacvd\_clustering.cp39-win\_amd64.pyd

Maybe you have some third-party antivirus software installed that removes binaries that it does not like.

---

<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:** [September 25, 2024, 3:16am UTC](https://discourse.slicer.org/t/importerror-with-uniform-remesh/38448/5 "2024-09-25T03:16:47Z")

</div>

@kucerabi have you had a chance to check if the .pyd file exists on your computer?

---

<div class="post-metadata">

**Author:** ![kucerabi](https://avatars.discourse-cdn.com/v4/letter/k/a88e57/32.png) [@kucerabi](https://discourse.slicer.org/u/kucerabi)\
**Post date:** [September 25, 2024, 4:39pm UTC](https://discourse.slicer.org/t/importerror-with-uniform-remesh/38448/6 "2024-09-25T16:39:45Z")

</div>

I have the .pyd file on my computer, but it still wouldn’t run. However, slicer.util.pip\_install(“pyacvd\<0.3”) resolved the issue.

Thank you!

---

<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:** [September 25, 2024, 10:41pm UTC](https://discourse.slicer.org/t/importerror-with-uniform-remesh/38448/7 "2024-09-25T22:41:29Z")

</div>

Thank you, this information is very useful. I’ve noticed a difference between pyacvd-0.2 and pyacvd-0.3: the .pyd file in the more recent version uses OpenMP.

~~To test if this is indeed causing the incompatibility of pyacvd-0.3 with your computer, would you mind do these steps:  
-install pyacvd-0.3.0 by runnning this in the Slicer Python console: `pip_install('pyacvd==0.3.0')`  
-download [libomp140.x86\_64.dll](https://raw.githubusercontent.com/rorymulcahey/libomp140.x86_64.dll/refs/heads/main/libomp140.x86_64.dll) library (if you want to learn more about this file, see [[1]](https://github.com/rorymulcahey/libomp140.x86_64.dll) or [[2]](https://discuss.pytorch.org/t/failed-to-import-pytorch-fbgemm-dll-or-one-of-its-dependencies-is-missing/201969/76))  
-copy the downloaded `libomp140.x86_64.dll` to the folder: `C:\Users\kucerabi\Desktop\Slicer 5.6.2\lib\Python\Lib\site-packages\pyacvd\`  
-test if uniform remeshing works and let us know here!~~

---

<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:** [September 25, 2024, 10:45pm UTC](https://discourse.slicer.org/t/importerror-with-uniform-remesh/38448/8 "2024-09-25T22:45:29Z")

</div>

The [developer of pyacvd will remove OpenMP dependency from pyacvd](https://github.com/pyvista/pyacvd/issues/56#issuecomment-2375355929), so you can also just wait for a few days and test with the latest pyacvd version.

---

<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:** [September 26, 2024, 12:50am UTC](https://discourse.slicer.org/t/importerror-with-uniform-remesh/38448/9 "2024-09-26T00:50:20Z")

</div>

A new version of pyacvd is ready that does not depend on OpenMP. Please try if it works:

```
pip_install("pyacvd==0.3.1")

```
