I am using MATLAB R2018a. I have installed CPython 3.6.7 and installed MATLAB engine as shown in the below link:
But I am getting the below error on executing "import matlab.engine":
pythonengine = importlib.import_module("matlabengineforpython"+_PYTHONVERSION) File "C:\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_unlockedModuleNotFoundError: No module named 'matlabengineforpython3_6' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Programs\Python\Python36\lib\site-packages\matlab\engine\__init__.py", line 59, in <module> pythonengine = importlib.import_module("matlabengineforpython"+_PYTHONVERSION) File "C:\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 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 658, in _load_unlocked File "<frozen importlib._bootstrap>", line 571, in module_from_spec File "<frozen importlib._bootstrap_external>", line 922, in create_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removedImportError: DLL load failed: The specified procedure could not be found. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python\Python36\lib\site-packages\matlab\engine\__init__.py", line 62, in <module> 'MathWorks Technical Support for assistance: %s' % e)
OSError: Please reinstall MATLAB Engine for Python or contact MathWorks Technical Support for assistance: DLL load failed: The specified procedure could not be found.
The file C:\Program Files\MATLAB\R2018a\extern\engines\python\dist\matlab\engine\win64\matlabengineforpython3_6.pyd also got created.
Best Answer