import os
import ctypes
os.path.dirname(os.path.abspath("Python_ESS_2-SWITCH.py"))
h = ctypes.WinDLL("ess_64.dll")
Both my OS and Python working directories are in the folder with the dll file I'm interested in.
The error that comes back is:
347 ##
348 if handle is None:
--> 349 self._handle = _dlopen(self._name, mode)
350 else:
351 self._handle = handle
OSError: [WinError 126] The specified module could not be found
When I go into the ctypes module that the error traces back to I can see that the module that cannot be loaded is LoadLibrary:
if _os.name in ("nt", "ce"):
print("in the if")
from _ctypes import LoadLibrary as _dlopen
There's another thread that suggested some solutions but they have not yielded results for me. If anyone has any ideas I'd be very greatful.