Matlab crashes when using py.matplot​lib.pyplot​.plot()

조회 수: 8 (최근 30일)
Fredrik P
Fredrik P 2020년 6월 20일
답변: Rajani Mishra 2020년 8월 26일
I want to use Python's matplotlib in Matlab but I can't make even this simple example
close; clear; clc;
x = py.numpy.arange(25);
y = py.numpy.square(x) + py.numpy.random.rand(int32(25));
py.matplotlib.pyplot.plot(x, y);
work as Matlab crashes after showing with the following dialog:
I'm afraid that I don't know how to proceed after reading this message. (Admittedly, I haven't tried reinstalling Matlab but I suspect that won't help.) After pressing OK, then Matlab closes with this dialog:
I'm on a Windows 10 machine and using 64-bit Anaconda Python 3.7.6 and have started Matlab from the Anaconda prompt.
Below is the report:
MATLAB crash file:C:\Users\User\AppData\Local\Temp\matlab_crash_dump.7792-1:
--------------------------------------------------------------------------------
abort() detected at lör jun 20 08:11:37 2020 +0200
--------------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : windows-1252
Deployed : false
Graphics Driver : Unknown hardware
Graphics card 1 : Intel Corporation ( 0x8086 ) Intel(R) HD Graphics 630 Version 26.20.100.7325 (2019-10-7)
Graphics card 2 : NVIDIA ( 0x10de ) NVIDIA GeForce GTX 1050 Ti Version 26.21.14.4145 (2019-11-26)
Java Version : Java 1.8.0_181-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Architecture : win64
MATLAB Entitlement ID : 2047564
MATLAB Root : C:\Program Files\MATLAB\R2019a
MATLAB Version : 9.6.0.1335978 (R2019a) Update 8
OpenGL : hardware
Operating System : Microsoft Windows 10 Home
Process ID : 7792
Processor ID : x86 Family 6 Model 158 Stepping 9, GenuineIntel
Session Key : 249e512e-f9e3-4782-921a-f7aa131946a5
Window System : Version 10.0 (Build 18362)
Fault Count: 1
Abnormal termination:
abort()
Register State (captured):
RAX = 0000000010bbdbb8 RBX = 0000000010bbdbb8
RCX = 00000000043f5be0 RDX = 0000000000000000
RSP = 00000000043f5b50 RBP = 00000000043f91d0
RSI = 0000000000000000 RDI = 0000000000000000
R8 = 00000000044ce050 R9 = 00007ff96d00e930
R10 = 0000000000000014 R11 = 00000000044c5820
R12 = 00000000043f6818 R13 = 0000000000000000
R14 = 0000000010badae8 R15 = 00000000043f6250
RIP = 0000000010953dba EFL = 00000206
CS = 0033 FS = 0053 GS = 002b
Stack Trace (captured):
[ 0] 0x000000001094b2c3 bin\win64\libmwfl.dll+00045763 foundation::core::diag::thread_context::unspecified_bool+00000051
[ 1] 0x0000000010949288 bin\win64\libmwfl.dll+00037512 foundation::core::diag::stacktrace_base::capture+00000024
[ 2] 0x000000001094e750 bin\win64\libmwfl.dll+00059216 foundation::core::diag::symbols::getSymbolAddress+00012656
[ 3] 0x000000001095299f bin\win64\libmwfl.dll+00076191 foundation::core::diag::is_terminate_message_enabled+00000607
[ 4] 0x0000000017484604 bin\win64\mcr.dll+01132036 mcr::shutdown::startWatchdog+00037076
[ 5] 0x0000000017483c77 bin\win64\mcr.dll+01129591 mcr::shutdown::startWatchdog+00034631
[ 6] 0x000000001747f4a0 bin\win64\mcr.dll+01111200 mcr::shutdown::startWatchdog+00016240
[ 7] 0x0000000017481537 bin\win64\mcr.dll+01119543 mcr::shutdown::startWatchdog+00024583
[ 8] 0x00007ff9718fcb7d C:\WINDOWS\System32\ucrtbase.dll+00445309 raise+00000477
[ 9] 0x00007ff9718fdb81 C:\WINDOWS\System32\ucrtbase.dll+00449409 abort+00000049
[ 10] 0x000000010f076a3a C:\ProgramData\Anaconda3\Library\bin\Qt5Core.dll+00158266 qt_logging_to_console+00000378
[ 11] 0x000000010f074dc3 C:\ProgramData\Anaconda3\Library\bin\Qt5Core.dll+00150979 QMessageLogger::fatal+00000147
[ 12] 0x00007ff925ea9e68 C:\ProgramData\Anaconda3\Library\bin\Qt5Gui.dll+00302696 QGuiApplicationPrivate::init+00003816
[ 13] 0x00007ff925ea7ffc C:\ProgramData\Anaconda3\Library\bin\Qt5Gui.dll+00294908 QGuiApplicationPrivate::createPlatformIntegration+00001564
[ 14] 0x00007ff925ea79bb C:\ProgramData\Anaconda3\Library\bin\Qt5Gui.dll+00293307 QGuiApplicationPrivate::createEventDispatcher+00000027
[ 15] 0x000000010f20a832 C:\ProgramData\Anaconda3\Library\bin\Qt5Core.dll+01812530 QCoreApplicationPrivate::init+00001138
[ 16] 0x00007ff925ea8fbd C:\ProgramData\Anaconda3\Library\bin\Qt5Gui.dll+00298941 QGuiApplicationPrivate::init+00000061
[ 17] 0x00000001113d44bf C:\ProgramData\Anaconda3\Library\bin\Qt5Widgets.dll+00083135 QApplicationPrivate::init+00000015
[ 18] 0x00000001113d04ab C:\ProgramData\Anaconda3\Library\bin\Qt5Widgets.dll+00066731 QApplication::QApplication+00000091
[ 19] 0x00007ff921830265 C:\ProgramData\Anaconda3\lib\site-packages\PyQt5\QtWidgets.pyd+00197221
[ 20] 0x00007ff95bde13bf C:\ProgramData\Anaconda3\lib\site-packages\sip.pyd+00005055
[ 21] 0x00007ff92dbdf7d7 C:\ProgramData\Anaconda3\python37.dll+00260055 PyObject_FastCallKeywords+00000999
[ 22] 0x00007ff92dbdf56a C:\ProgramData\Anaconda3\python37.dll+00259434 PyObject_FastCallKeywords+00000378
[ 23] 0x00007ff92dbe761e C:\ProgramData\Anaconda3\python37.dll+00292382 PyMethodDef_RawFastCallKeywords+00003326
[ 24] 0x00007ff92dbe8002 C:\ProgramData\Anaconda3\python37.dll+00294914 PyEval_EvalFrameDefault+00002226
[ 25] 0x00007ff92dbe74d3 C:\ProgramData\Anaconda3\python37.dll+00292051 PyMethodDef_RawFastCallKeywords+00002995
[ 26] 0x00007ff92dbe7bff C:\ProgramData\Anaconda3\python37.dll+00293887 PyEval_EvalFrameDefault+00001199
[ 27] 0x00007ff92dbd1036 C:\ProgramData\Anaconda3\python37.dll+00200758 PyEval_EvalCodeWithName+00000422
[ 28] 0x00007ff92dbe75ec C:\ProgramData\Anaconda3\python37.dll+00292332 PyMethodDef_RawFastCallKeywords+00003276
[ 29] 0x00007ff92dbe8749 C:\ProgramData\Anaconda3\python37.dll+00296777 PyEval_EvalFrameDefault+00004089
[ 30] 0x00007ff92dbd1036 C:\ProgramData\Anaconda3\python37.dll+00200758 PyEval_EvalCodeWithName+00000422
[ 31] 0x00007ff92dbd0cba C:\ProgramData\Anaconda3\python37.dll+00199866 PyFunction_FastCallDict+00000442
[ 32] 0x00007ff92dbced43 C:\ProgramData\Anaconda3\python37.dll+00191811 PyTuple_New+00001011
[ 33] 0x00007ff92dbdf7d7 C:\ProgramData\Anaconda3\python37.dll+00260055 PyObject_FastCallKeywords+00000999
[ 34] 0x00007ff92dbdf56a C:\ProgramData\Anaconda3\python37.dll+00259434 PyObject_FastCallKeywords+00000378
[ 35] 0x00007ff92dbe761e C:\ProgramData\Anaconda3\python37.dll+00292382 PyMethodDef_RawFastCallKeywords+00003326
[ 36] 0x00007ff92dbe8002 C:\ProgramData\Anaconda3\python37.dll+00294914 PyEval_EvalFrameDefault+00002226
[ 37] 0x00007ff92dbe74d3 C:\ProgramData\Anaconda3\python37.dll+00292051 PyMethodDef_RawFastCallKeywords+00002995
[ 38] 0x00007ff92dbe8002 C:\ProgramData\Anaconda3\python37.dll+00294914 PyEval_EvalFrameDefault+00002226
[ 39] 0x00007ff92dbd1036 C:\ProgramData\Anaconda3\python37.dll+00200758 PyEval_EvalCodeWithName+00000422
[ 40] 0x00007ff92dbd0cba C:\ProgramData\Anaconda3\python37.dll+00199866 PyFunction_FastCallDict+00000442
[ 41] 0x00007ff92dbcfc7a C:\ProgramData\Anaconda3\python37.dll+00195706 PyMethodDef_RawFastCallDict+00000938
[ 42] 0x00007ff92dbefbf4 C:\ProgramData\Anaconda3\python37.dll+00326644 PySlice_New+00000436
[ 43] 0x00007ff92dbe88c4 C:\ProgramData\Anaconda3\python37.dll+00297156 PyEval_EvalFrameDefault+00004468
[ 44] 0x00007ff92dbd1036 C:\ProgramData\Anaconda3\python37.dll+00200758 PyEval_EvalCodeWithName+00000422
[ 45] 0x00007ff92dbe75ec C:\ProgramData\Anaconda3\python37.dll+00292332 PyMethodDef_RawFastCallKeywords+00003276
[ 46] 0x00007ff92dbe7bff C:\ProgramData\Anaconda3\python37.dll+00293887 PyEval_EvalFrameDefault+00001199
[ 47] 0x00007ff92dbe74d3 C:\ProgramData\Anaconda3\python37.dll+00292051 PyMethodDef_RawFastCallKeywords+00002995
[ 48] 0x00007ff92dbe7bff C:\ProgramData\Anaconda3\python37.dll+00293887 PyEval_EvalFrameDefault+00001199
[ 49] 0x00007ff92dbd1036 C:\ProgramData\Anaconda3\python37.dll+00200758 PyEval_EvalCodeWithName+00000422
[ 50] 0x00007ff92dbe75ec C:\ProgramData\Anaconda3\python37.dll+00292332 PyMethodDef_RawFastCallKeywords+00003276
[ 51] 0x00007ff92dbe7bff C:\ProgramData\Anaconda3\python37.dll+00293887 PyEval_EvalFrameDefault+00001199
[ 52] 0x00007ff92dbd1036 C:\ProgramData\Anaconda3\python37.dll+00200758 PyEval_EvalCodeWithName+00000422
[ 53] 0x00007ff92dbd0cba C:\ProgramData\Anaconda3\python37.dll+00199866 PyFunction_FastCallDict+00000442
[ 54] 0x00007ff92dbc4987 C:\ProgramData\Anaconda3\python37.dll+00149895 PyObject_Call+00000211
[ 55] 0x000000010c758b7f bin\win64\pycli.dll+00101247
[ 56] 0x000000010c753f5b bin\win64\pycli.dll+00081755
[ 57] 0x000000010c794c79 bin\win64\pycli.dll+00347257
[ 58] 0x00000000283684d0 bin\win64\pgo\mcos_impl.dll+00623824
[ 59] 0x0000000028367c72 bin\win64\pgo\mcos_impl.dll+00621682
[ 60] 0x0000000028366d6b bin\win64\pgo\mcos_impl.dll+00617835
[ 61] 0x000000002836545a bin\win64\pgo\mcos_impl.dll+00611418
[ 62] 0x0000000028364c02 bin\win64\pgo\mcos_impl.dll+00609282
[ 63] 0x00000000283648a8 bin\win64\pgo\mcos_impl.dll+00608424
[ 64] 0x000000002836646e bin\win64\pgo\mcos_impl.dll+00615534
[ 65] 0x00000000175b8f49 bin\win64\pgo\m_dispatcher.dll+00036681 AutoPushingExecutionFrame::AutoPushingExecutionFrame+00000825
[ 66] 0x00000000175b80bd bin\win64\pgo\m_dispatcher.dll+00032957 Mfh_MATLAB_fn_impl::dispatch+00000045
[ 67] 0x000000001845c529 bin\win64\pgo\m_lxe.dll+00378153
[ 68] 0x00000000185ed3d6 bin\win64\pgo\m_lxe.dll+02020310 MathWorks::lxe::StartupLxeEngine+00025634
[ 69] 0x00000000185ed24a bin\win64\pgo\m_lxe.dll+02019914 MathWorks::lxe::StartupLxeEngine+00025238
[ 70] 0x0000000018462b61 bin\win64\pgo\m_lxe.dll+00404321
[ 71] 0x0000000018616549 bin\win64\pgo\m_lxe.dll+02188617 mwboost::archive::detail::oserializer<mwboost::archive::binaryTerm_oarchive,std::vector<unsigned int,std::allocator<unsigned int> > >::oserializer<mwboost::archive::binaryTerm_oarchive,std::vector<unsigned int,std::allocator<unsigned int> > >+00016141
[ 72] 0x00000000185680dc bin\win64\pgo\m_lxe.dll+01474780
[ 73] 0x0000000018568dc3 bin\win64\pgo\m_lxe.dll+01478083
[ 74] 0x000000001856af0d bin\win64\pgo\m_lxe.dll+01486605
[ 75] 0x000000001856a2ef bin\win64\pgo\m_lxe.dll+01483503
[ 76] 0x000000001856a81c bin\win64\pgo\m_lxe.dll+01484828
[ 77] 0x00000000184612ed bin\win64\pgo\m_lxe.dll+00398061
[ 78] 0x0000000018467c65 bin\win64\pgo\m_lxe.dll+00425061
[ 79] 0x00000000184670dc bin\win64\pgo\m_lxe.dll+00422108
[ 80] 0x00000000184f2a89 bin\win64\pgo\m_lxe.dll+00993929
[ 81] 0x00000000184f2117 bin\win64\pgo\m_lxe.dll+00991511
[ 82] 0x00000000184f218a bin\win64\pgo\m_lxe.dll+00991626
[ 83] 0x0000000018615a34 bin\win64\pgo\m_lxe.dll+02185780 mwboost::archive::detail::oserializer<mwboost::archive::binaryTerm_oarchive,std::vector<unsigned int,std::allocator<unsigned int> > >::oserializer<mwboost::archive::binaryTerm_oarchive,std::vector<unsigned int,std::allocator<unsigned int> > >+00013304
[ 84] 0x00000000186159e2 bin\win64\pgo\m_lxe.dll+02185698 mwboost::archive::detail::oserializer<mwboost::archive::binaryTerm_oarchive,std::vector<unsigned int,std::allocator<unsigned int> > >::oserializer<mwboost::archive::binaryTerm_oarchive,std::vector<unsigned int,std::allocator<unsigned int> > >+00013222
[ 85] 0x00000000184367ed bin\win64\pgo\m_lxe.dll+00223213
[ 86] 0x00000000179ad62f bin\win64\pgo\m_interpreter.dll+00382511 inEvalCmdWithLocalReturn+00000063
[ 87] 0x00000000fb60fbc4 bin\win64\libmwbridge.dll+00129988 mnParser+00001316
[ 88] 0x0000000017449518 bin\win64\mcr.dll+00890136 mcrInstance::releaseThread+00002552
[ 89] 0x000000001738c28a bin\win64\mcr.dll+00115338 mcrOptions::set_use_license_manager+00080058
[ 90] 0x00000000173aa284 bin\win64\mcr.dll+00238212 mcrOptions::set_use_license_manager+00202932
[ 91] 0x00000000fd02648e bin\win64\iqm.dll+00615566 iqm::PackagedTaskPlugin::execute+00000894
[ 92] 0x00000000fd026303 bin\win64\iqm.dll+00615171 iqm::PackagedTaskPlugin::execute+00000499
[ 93] 0x00000000173f0d2b bin\win64\mcr.dll+00527659 mcr::runtime::setInterpreterThreadSingletonToCurrent+00185515
[ 94] 0x00000000fd004b77 bin\win64\iqm.dll+00478071 iqm::Iqm::setupIqmFcnPtrs+00088151
[ 95] 0x00000000fd004bc9 bin\win64\iqm.dll+00478153 iqm::Iqm::setupIqmFcnPtrs+00088233
[ 96] 0x00000000fd004977 bin\win64\iqm.dll+00477559 iqm::Iqm::setupIqmFcnPtrs+00087639
[ 97] 0x00000000fcfde613 bin\win64\iqm.dll+00321043 iqm::Iqm::create+00009283
[ 98] 0x00000000fcfddd9f bin\win64\iqm.dll+00318879 iqm::Iqm::create+00007119
[ 99] 0x00000000173ce4f3 bin\win64\mcr.dll+00386291 mcr::runtime::setInterpreterThreadSingletonToCurrent+00044147
[100] 0x00000000173ceaff bin\win64\mcr.dll+00387839 mcr::runtime::setInterpreterThreadSingletonToCurrent+00045695
[101] 0x00000000173cd95c bin\win64\mcr.dll+00383324 mcr::runtime::setInterpreterThreadSingletonToCurrent+00041180
[102] 0x000000001748e73c bin\win64\mcr.dll+01173308 mcr::mvm::detail::activateMcr+00016364
[103] 0x00000000172bf951 bin\win64\MVMLocal.dll+00391505 mvm_server::inproc::LocalFactory::terminate+00186993
[104] 0x00000000fa9e15e0 bin\win64\mvm.dll+01775072 mvm::detail::SessionImpl::initWithOptions+00000592
[105] 0x00000000fa9e22a0 bin\win64\mvm.dll+01778336 mvm::detail::SessionImpl::runMain+00000128
[106] 0x00000000fa9e24cc bin\win64\mvm.dll+01778892 mvm::detail::SessionImpl::runMatlabDesktop+00000268
[107] 0x0000000140007016 bin\win64\MATLAB.exe+00028694 mwboost::serialization::singleton_module::unlock+00000950
[108] 0x0000000140007eeb bin\win64\MATLAB.exe+00032491 mwboost::serialization::singleton_module::unlock+00004747
[109] 0x00007ff973c97bd4 C:\WINDOWS\System32\KERNEL32.DLL+00097236 BaseThreadInitThunk+00000020
[110] 0x00007ff9743ace51 C:\WINDOWS\SYSTEM32\ntdll.dll+00446033 RtlUserThreadStart+00000033

답변 (1개)

Rajani Mishra
Rajani Mishra 2020년 8월 26일
MATLAB does not supports Anaconda Python, it supports the reference implementation of Python, often called CPython, versions 2.7, 3.6, and 3.7. To learn about installation refer to this link: Install Supported Python Implementation.
For the issue being faced you can refer to this answer: https://www.mathworks.com/matlabcentral/answers/427187-problem-with-python-numpy. However, it is recommended to use the supported implementation of Python.

카테고리

Help CenterFile Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by