I've resolved the error I had when importing CNTK on a machine with a fresh installation of Windows 10, so I'll summarize it as it might be useful to someone.
Then I launched Python from the console and imported it.
python
>>> import cntk as C
Then
Traceback (most recent call last):
File "C:\Users\---\AppData\Local\Programs\Python\Python36\lib\site-packages\cntk\cntk_py.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\---\AppData\Local\Programs\Python\Python36\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'cntk._cntk_py'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
import cntk
File "C:\Users\---\AppData\Local\Programs\Python\Python36\lib\site-packages\cntk\__init__.py", line 10, in <module>
from . import cntk_py
File "C:\Users\---\AppData\Local\Programs\Python\Python36\lib\site-packages\cntk\cntk_py.py", line 21, in <module>
_cntk_py = swig_import_helper()
File "C:\Users\---\AppData\Local\Programs\Python\Python36\lib\site-packages\cntk\cntk_py.py", line 20, in swig_import_helper
return importlib.import_module('_cntk_py')
File "C:\Users\---\AppData\Local\Programs\Python\Python36\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: The specified module could not be found.
I've omitted the user name, but apparently I'm getting ModuleNotFoundError and ImportError (・ _ ・;)
In conclusion, I was able to solve it by installing Microsoft Visual C ++ 2015 Redistributable.
Microsoft Visual C++ 2015 Redistributable
After downloading and installing the installer for my machine from the URL, I was able to successfully import CNTK.
Recommended Posts