我想查看用于Python的matlab引擎。我按照here的指示安装了它。但只是一行
import matlab.engine
导致我的程序退出并退出代码139,我理解是某种内存故障。我正在运行Python 2.7.10(Anaconda 2.3.0发行版),Matlab 2014b,MacOS 10.10,x86_64。
编辑:这是堆栈跟踪。
* thread #1: tid = 0x1b1703, 0x0000000000000000, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
* frame #0: 0x0000000000000000
frame #1: 0x0000000104eab0dd libpython2.7.dylib`PyEval_GetGlobals + 23
frame #2: 0x0000000104eba62b libpython2.7.dylib`PyImport_Import + 137
frame #3: 0x0000000104eb8d27 libpython2.7.dylib`PyImport_ImportModule + 31
frame #4: 0x00000001028e2063 matlabengineforpython2_7.so`initmatlabengineforpython2_7 + 19
frame #5: 0x00000001000df8d1 libpython2.7.dylib`_PyImport_LoadDynamicModule + 177
frame #6: 0x00000001000dd60b libpython2.7.dylib`import_submodule + 315
frame #7: 0x00000001000ddaba libpython2.7.dylib`load_next + 234
frame #8: 0x00000001000de470 libpython2.7.dylib`PyImport_ImportModuleLevel + 336
frame #9: 0x00000001000bc023 libpython2.7.dylib`builtin___import__ + 131
frame #10: 0x00000001000c39bd libpython2.7.dylib`PyEval_EvalFrameEx + 24989
frame #11: 0x00000001000c5ca3 libpython2.7.dylib`PyEval_EvalCodeEx + 2115
frame #12: 0x00000001000c3d10 libpython2.7.dylib`PyEval_EvalFrameEx + 25840
frame #13: 0x00000001000c5ca3 libpython2.7.dylib`PyEval_EvalCodeEx + 2115
frame #14: 0x00000001000c5dc6 libpython2.7.dylib`PyEval_EvalCode + 54
frame #15: 0x00000001000dc0f0 libpython2.7.dylib`PyImport_ExecCodeModuleEx + 208
frame #16: 0x00000001000dce92 libpython2.7.dylib`load_source_module + 626
frame #17: 0x00000001000dddf0 libpython2.7.dylib`load_package + 400
frame #18: 0x00000001000dd60b libpython2.7.dylib`import_submodule + 315
frame #19: 0x00000001000ddaba libpython2.7.dylib`load_next + 234
frame #20: 0x00000001000de4bc libpython2.7.dylib`PyImport_ImportModuleLevel + 412
frame #21: 0x00000001000bc023 libpython2.7.dylib`builtin___import__ + 131
frame #22: 0x000000010000c7b2 libpython2.7.dylib`PyObject_Call + 98
frame #23: 0x00000001000bc567 libpython2.7.dylib`PyEval_CallObjectWithKeywords + 87
frame #24: 0x00000001000c1366 libpython2.7.dylib`PyEval_EvalFrameEx + 15174
frame #25: 0x00000001000c5ca3 libpython2.7.dylib`PyEval_EvalCodeEx + 2115
frame #26: 0x00000001000c5dc6 libpython2.7.dylib`PyEval_EvalCode + 54
frame #27: 0x00000001000eb17e libpython2.7.dylib`PyRun_FileExFlags + 174
frame #28: 0x00000001000eb41a libpython2.7.dylib`PyRun_SimpleFileExFlags + 458
frame #29: 0x000000010010248d libpython2.7.dylib`Py_Main + 3165
frame #30: 0x0000000100000f54 python`start + 52
编辑2:我不确定哪种跟踪更有帮助,但我也尝试使用定义的trace_calls函数生成跟踪here。这是最后几行:
Call to dirname on line 120 of /Users/katherine/anaconda/lib/python2.7/posixpath.py from line 38 of /Users/katherine/anaconda/lib/python2.7/site-packages/matlab/engine/__init__.py
Call to import_module on line 20 of /Users/katherine/anaconda/lib/python2.7/importlib/__init__.py from line 42 of /Users/katherine/anaconda/lib/python2.7/site-packages/matlab/engine/__init__.py
Call to import_module on line 20 of /Users/katherine/anaconda/lib/python2.7/importlib/__init__.py from line 58 of /Users/katherine/anaconda/lib/python2.7/site-packages/matlab/engine/__init__.py
有谁知道如何解决这个问题?
非常感谢您提供的任何帮助。