I am not able to import powerfactory module: DLL load failed

Category:
Scripting
Answer

If an error message appears when importing the powerfactory module stating “ DLL load failed: the specified module could not be found”, this means that Microsoft Visual C++ Redistributable for Visual Studio 2012 package is not installed on the computer.


To overcome this problem the user should add the PowerFactory installation directory to the os path variable within his python script:

 

import os
os.environ["PATH"] = r"C:\Program Files\DIgSILENT\PowerFactory 2022 SP3;"+ os.environ["PATH"]

Back