I am trying to run a "homemade" package I recently received. It is native C++ code wrapped with SWIG. EDIT: I have installed all the C++ dependencies required. I know that the package works, as it was previously set-up in other computers.
The code found in __ init __.py is as follows:
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_Pack', [dirname(__file__)])
except ImportError:
import _Pack
return _Pack
if fp is not None:
try:
print ('_Pack', fp, pathname, description)
_mod = imp.load_module('_Pack', fp, pathname, description)
finally:
fp.close()
return _mod
_Hydra = swig_import_helper()
del swig_import_helper
else:
import _Hydra
del version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.`
When I run it, I get the following error:
C:\Users\jun\Documents\_test>python __init__.py
Traceback (most recent call last):
File "__init__.py", line 42, in <module>
_Pack = swig_import_helper()
File "__init__.py", line 35, in swig_import_helper
_mod = imp.load_module('_Pack', fp, pathname, description)
File "C:\Users\jun\AppData\Local\Programs\Python\Python35-32\lib\imp.py",
line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\jun\AppData\Local\Programs\Python\Python35-32\lib\imp.py",
line 342, in load_dynamic
return _load(spec)
File "<frozen importlib._bootstrap>", line 693, in _load
File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
File "<frozen importlib._bootstrap>", line 577, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 914, in create_module
File "<frozen importlib._bootstrap>", line 222, in
_call_with_frames_removed ImportError: DLL load failed: The specified module could not be found.
This error was generated in Windows 7 64-bit, using Python 3.5.3-32 bit. My observation was that the problem lies in load_module, but I really cannot pinpoint why the module cannot be loaded. Any ideas?