I tried to import a compiled Python-module inside a Dynamo code block, but i cant get it to work.
The file “example_module.pyd” was created the following way:
cythonize -i -3 example_module.py
example_module.py:
def greet(name):
return f"Hello, {name} :D"
Python code block:
# Import builtin library
import sys
# Append path to list
sys.path.append("path-to-pyd-folder")
# Import pyd module
import example_module
module_path = example_module.__file__
return_value = example_module.greet("Dynamo")
OUT = [module_path, return_value]
But i only get a error message: ImportError : DLL load failed while importing example_module
.
Does anybody have a idea how to fix this error? Unfortunately as a new user i cannot upload any data to let you test the file.
Kind regards
Phil