I currently seem to have a dependency/DLL error in my python script. I want to use both the FreeCAD python packages (Fem library package precisely) and the netgen library. Netgen is an open-source meshing tool.
I have no issues using both packages on their own. Every i want to do runs perfectly. However, I need to use both of these packages in my script (as I first manually mesh my piece and then proceed to an Fem). When I include both of these packages :
import Fem
import netgen
Depending on which order these two are, I get either one of these errors :
Traceback (most recent call last):
File "c:/Users/username/AppData/Roaming/FreeCAD/Macro/meshing_trials.py", line 120, in <module>
import netgen
File "C:\Users\username\AppData\Local\Programs\FreeCAD 0.21\bin\lib\site-packages\netgen\__init__.py", line 44, in <module>
from . import libngpy
ImportError: DLL load failed while importing libngpy: The specified procedure could not be found.
or
Traceback (most recent call last):
File "c:/Users/username/AppData/Roaming/FreeCAD/Macro/meshing_trials.py", line 11, in <module>
import Fem
ImportError: DLL load failed while importing Fem: The specified procedure could not be found.
From what I saw online, this error generally means that the DLL cannot find all the relevant libraries. However, as each package on its own works well, I was thinking that using both of them would be causing a dependency issue.
What can be done? How can I understand what is causing this error and how can I solve it? I first asked this question on FreeCAD's forum, without any luck. As I believe it's quite "general", I hope that someone here might have a hint.
I already tried to look at other forum posts but they don't seem to be fitted to my case as each library works on its own.