I'm relatively new to Python and am trying to import some modules that were written by a 3rd party. They are called ok.py and _ok.pyd. I am trying to 'import ok', which references _ok.pyd, but it is not working. They are both in my site-packages directory, and I've added that path name to my Spyder PYTHONPATH variable. I've also tried putting them both in the current working directory, but to no avail.
All I do is type 'import ok' and I get the following error messages.
Traceback (most recent call last):
File "D:\Anaconda3\Lib\site-packages\ok.py", line 15, in swig_import_helper return importlib.import_module(mname)
File "D:\Anaconda3\lib\importlib_init_.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 670, in _load_unlocked
File "", line 583, in module_from_spec
File "", line 1043, in create_module
File "", line 219, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in import ok
File "D:\Anaconda3\Lib\site-packages\ok.py", line 18, in _ok = swig_import_helper()
File "D:\Anaconda3\Lib\site-packages\ok.py", line 17, in swig_import_helper return importlib.import_module('_ok')
File "D:\Anaconda3\lib\importlib_init_.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: The specified module could not be found.
The following is the ok.py code where it fails. I've done an image so line numbers are visible.
Is there something easy I'm missing here, or is it unsolvable without the 3rd party vendor updating their code? It just looks like the importlib.import_module() cannot find _ok, but it is in the directory. When I type importlib.import_module() for other module names in that directory it works, so what are possible causes for this one not working?
Thank you.