import matlab.engine,请教python导入matlab engine失败的问题。

用户在尝试导入Matlab Engine for Python时遇到了错误。已经按照Matlab帮助文档安装了32位Matlab2015b和Python3.4,并在CMD中以管理员身份运行。尽管`import matlab`成功,但`import matlab.engine`时出现ImportError,提示找不到'matlabengineforpython3_4'模块和DLL加载失败。这可能是由于Python和Matlab版本不兼容或者环境变量设置不正确导致。

大家好!我按照matlab帮助文档上的步骤,进入matlabroot\extern\engines\python目录中,执行python setup.py install安装好了matlab engine for python,采用的是32位 matlab2015b版本,

python3.4,win7中的CMD.exe也是管理员身份运行,安装没有报错,看到python3.4\Lib\site-packages中已经有matlab的包。

但是在Python中使用时,导入matlab是没有问题的,导入matlab engine就报错,信息如下,请高手帮忙分析一下:

>>> import matlab

>>> import matlab.engine

Traceback (most recent call last):

File "D:\WinPython\python-3.4.4\lib\site-packages\matlab\engine\__init__.py", line 42, in

pythonengine = importlib.import_module("matlabengineforpython"+_PYTHONVERSION)

File "D:\WinPython\python-3.4.4\lib\importlib\__init__.py", line 109, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

File "", line 2254, in _gcd_import

File "", line 2237, in _find_and_load

File "", line 2224, in _find_and_load_unlocked

ImportError: No module named 'matlabengineforpython3_4'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "D:\WinPython\python-3.4.4\lib\site-packages\matlab\engine\__init__.py", line 58, in

pythonengine = importlib.import_module("matlabengineforpython"+_PYTHONVERSION)

File "D:\WinPython\python-3.4.4\lib\importlib\__init__.py", line 109, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

File "", line 2254, in _gcd_import

File "", line 2237, in _find_and_load

File "", line 2226, in _find_and_load_unlocked

File "", line 1191, in _load_unlocked

File "", line 1161, in _load_backward_compatible

File "", line 539, in _check_name_wrapper

File "", line 1715, in load_module

File "", line 321, in _call_with_frames_removed

ImportError: DLL load failed: 找不到指定的程序。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "", line 1, in

import matlab.engine

File "D:\WinPython\python-3.4.4\lib\site-packages\matlab\engine\__init__.py", line 60, in

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值