PyPlot.show throws an exception (Win10 | Julia 1.10.0 )

New to Julia so possibly getting something all wrong here. When the Julia (1.10.0) script reaches Pyplot.show (line 107) the following exception is thrown. Laptop has Python 3.9.16 and Conda 23.1.0 installed.

Any ideas?

Thank you in advance,
Rami

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: UNKNOWN at 0x7ffcdb94cf19 ā€“ RaiseException at C:\WINDOWS\System32\KERNELBASE.dll (unknown line)
in expression starting at C:\Users\RZ\OneDrive\docs\sample3.jl:107
RaiseException at C:\WINDOWS\System32\KERNELBASE.dll (unknown line)
mkl_serv_getenv at C:\Users\RZ.julia\conda\3\x86_64\Library\bin\mkl_intel_thread.2.dll (unknown line)
mkl_serv_getenv at C:\Users\RZ.julia\conda\3\x86_64\Library\bin\mkl_intel_thread.2.dll (unknown line)
mkl_serv_domain_get_max_threads at C:\Users\RZ.julia\conda\3\x86_64\Library\bin\mkl_intel_thread.2.dll (unknown line)
mkl_blas_dgemm at C:\Users\RZ.julia\conda\3\x86_64\Library\bin\mkl_intel_thread.2.dll (unknown line)
dgemm at C:\Users\RZ.julia\conda\3\x86_64\Library\bin\libcblas.dll (unknown line)
cblas_dgemm at C:\Users\RZ.julia\conda\3\x86_64\Library\bin\libcblas.dll (unknown line)
PyInit__multiarray_umath at C:\Users\RZ.julia\conda\3\x86_64\lib\site-packages\numpy\core_multiarray_umath.cp310-win_amd64.pyd (unknown line)
unknown function (ip: 00007ffc0da1d7fb)
unknown function (ip: 00007ffc0da202b1)
PyCFunction_GetFlags at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
unknown function (ip: 00007ffc0d9d2028)
unknown function (ip: 00007ffc0d9d2853)
PyOS_URandomNonblock at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_GetFuncDesc at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyFunction_Vectorcall at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyOS_URandomNonblock at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_GetFuncDesc at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyFunction_Vectorcall at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyOS_URandomNonblock at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_GetFuncDesc at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyFunction_Vectorcall at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyOS_URandomNonblock at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_GetFuncDesc at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyFunction_Vectorcall at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyOS_URandomNonblock at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_GetFuncDesc at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyFunction_Vectorcall at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyOS_URandomNonblock at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_GetFuncDesc at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyFunction_Vectorcall at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_GetFuncDesc at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyFunction_Vectorcall at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyOS_URandomNonblock at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_GetFuncDesc at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyFunction_Vectorcall at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyCell_Set at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyMethod_Self at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyOS_URandomNonblock at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_GetFuncDesc at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyFunction_Vectorcall at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyOS_URandomNonblock at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_GetFuncDesc at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyFunction_Vectorcall at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_GetFuncDesc at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyFunction_Vectorcall at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_GetFuncDesc at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyFunction_Vectorcall at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyCell_Set at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyMethod_Self at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
unknown function (ip: 00007ffca233448d)
TclNRRunCallbacks at C:\Users\RZ.julia\conda\3\x86_64\Library\bin\tcl86t.dll (unknown line)
TclServiceIdle at C:\Users\RZ.julia\conda\3\x86_64\Library\bin\tcl86t.dll (unknown line)
TclServiceIdle at C:\Users\RZ.julia\conda\3\x86_64\Library\bin\tcl86t.dll (unknown line)
Tcl_DoOneEvent at C:\Users\RZ.julia\conda\3\x86_64\Library\bin\tcl86t.dll (unknown line)
TkCreateFrame at C:\Users\RZ.julia\conda\3\x86_64\Library\bin\tk86t.dll (unknown line)
TclServiceIdle at C:\Users\RZ.julia\conda\3\x86_64\Library\bin\tcl86t.dll (unknown line)
Tcl_DoOneEvent at C:\Users\RZ.julia\conda\3\x86_64\Library\bin\tcl86t.dll (unknown line)
TkCreateFrame at C:\Users\RZ.julia\conda\3\x86_64\Library\bin\tk86t.dll (unknown line)
TclServiceIdle at C:\Users\RZ.julia\conda\3\x86_64\Library\bin\tcl86t.dll (unknown line)
Tcl_DoOneEvent at C:\Users\RZ.julia\conda\3\x86_64\Library\bin\tcl86t.dll (unknown line)
unknown function (ip: 00007ffca2334c35)
unknown function (ip: 00007ffca233647e)
PyComplex_AsCComplex at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyOS_URandomNonblock at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_GetFuncDesc at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyFunction_Vectorcall at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyCell_Set at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyMethod_Self at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyOS_URandomNonblock at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_GetFuncDesc at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyFunction_Vectorcall at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyCell_Set at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyMethod_Self at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyOS_URandomNonblock at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_GetFuncDesc at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyFunction_Vectorcall at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyCell_Set at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyMethod_Self at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_GetFuncDesc at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
PyFunction_Vectorcall at C:\Users\RZ.julia\conda\3\x86_64\python310.dll (unknown line)
macro expansion at C:\Users\RZ.julia\packages\PyCall\1gn3u\src\exception.jl:108 [inlined]
#107 at C:\Users\RZ.julia\packages\PyCall\1gn3u\src\pyfncall.jl:43 [inlined]
disable_sigint at .\c.jl:473 [inlined]
__pycall! at C:\Users\RZ.julia\packages\PyCall\1gn3u\src\pyfncall.jl:42 [inlined]
_pycall! at C:\Users\RZ.julia\packages\PyCall\1gn3u\src\pyfncall.jl:29
_pycall! at C:\Users\RZ.julia\packages\PyCall\1gn3u\src\pyfncall.jl:11 [inlined]
pycall#112 at C:\Users\RZ.julia\packages\PyCall\1gn3u\src\pyfncall.jl:80 [inlined]
pycall at C:\Users\RZ.julia\packages\PyCall\1gn3u\src\pyfncall.jl:80 [inlined]
show#149 at C:\Users\RZ.julia\packages\PyPlot\2MlrT\src\PyPlot.jl:200 [inlined]
show at C:\Users\RZ.julia\packages\PyPlot\2MlrT\src\PyPlot.jl:200
unknown function (ip: 0000029176465cd4)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
do_call at C:/workdir/src\interpreter.c:126
eval_value at C:/workdir/src\interpreter.c:223
eval_stmt_value at C:/workdir/src\interpreter.c:174 [inlined]
eval_body at C:/workdir/src\interpreter.c:635
jl_interpret_toplevel_thunk at C:/workdir/src\interpreter.c:775
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:934
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:877
ijl_toplevel_eval at C:/workdir/src\toplevel.c:943 [inlined]
ijl_toplevel_eval_in at C:/workdir/src\toplevel.c:985
eval at .\boot.jl:385 [inlined]
include_string at .\loading.jl:2070
_include at .\loading.jl:2130
include at .\Base.jl:495
jfptr_include_49873.1 at C:\Users\RZ.julia\juliaup\julia-1.10.0+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
exec_options at .\client.jl:318
_start at .\client.jl:552
jfptr__start_86719.1 at C:\Users\RZ.julia\juliaup\julia-1.10.0+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
true_main at C:/workdir/src\jlapi.c:582
jl_repl_entrypoint at C:/workdir/src\jlapi.c:731
mainCRTStartup at C:/workdir/cli\loader_exe.c:58
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 5862575 (Pool: 5857261; Big: 5314); GC: 9

Are you using MKL.jl in Julia? You may be seeing a conflict between the MKL library linked by Numpy and the one linked by Julia (which may not use the same ABI). A simple workaround in that case would be to not use MKL.jl, and just use the default OpenBLAS libraryl.

Shared library conflicts are a notorious pain (ā€œDLL Hellā€).

1 Like

Thank you, but to be honest i would not know whether or not i am using MKL.jl? How do i check this? And if i do, how do refrain from using it and revert to default?

Cheers
Rami

Could you provide the output of the following commands in the Julia REPL?

julia> using Pkg

julia> pkg"status"

julia> pkg"status -m"

If you want to try to do a simple test try this.

julia> using Pkg

julia> pkg"activate --temp"

julia> pkg"add PyPlot"

Alternately there is also PythonPlot.jl

julia> using Pkg

julia> pkg"activate --temp"

julia> pkg"add PythonPlot"
1 Like

Thank you, there you go (looks like PyPlot is there)

julia> pkg"status"
Status C:\Users\RZ\.julia\environments\v1.10\Project.toml
[d330b81b] PyPlot v2.11.2

julia> pkg"status -m"
Status C:\Users\RZ\.julia\environments\v1.10\Manifest.toml
[3da002f7] ColorTypes v0.11.4
[5ae59095] Colors v0.12.10
[8f4d0f93] Conda v1.10.0
[53c48c17] FixedPointNumbers v0.8.4
[682c06a0] JSON v0.21.4
[b964fa9f] LaTeXStrings v1.3.1
[1914dd2f] MacroTools v0.5.13
[69de0a69] Parsers v2.8.1
[aea7be01] PrecompileTools v1.2.0
[21216c6a] Preferences v1.4.1
[438e738f] PyCall v1.96.4
[d330b81b] PyPlot v2.11.2
[189a3867] Reexport v1.2.2
[81def892] VersionParsing v1.3.0
[0dad84c5] ArgTools v1.1.1
[56f22d72] Artifacts
[2a0f44e3] Base64
[ade2ca70] Dates
[f43a241f] Downloads v1.6.0
[7b1f6079] FileWatching
[b77e0a4c] InteractiveUtils
[b27032c2] LibCURL v0.6.4
[8f399da3] Libdl
[37e2e46d] LinearAlgebra
[56ddb016] Logging
[d6f4376e] Markdown
[a63ad114] Mmap
[ca575930] NetworkOptions v1.2.0
[de0858da] Printf
[9a3f8284] Random
[ea8e919c] SHA v0.7.0
[9e88b42a] Serialization
[6462fe0b] Sockets
[2f01184e] SparseArrays v1.10.0
[10745b16] Statistics v1.10.0
[fa267f1f] TOML v1.0.3
[8dfed614] Test
[cf7118a7] UUIDs
[4ec0a83e] Unicode
[e66e0078] CompilerSupportLibraries_jll v1.0.5+1
[deac9b47] LibCURL_jll v8.4.0+0
[29816b5a] LibSSH2_jll v1.11.0+1
[c8ffd9c3] MbedTLS_jll v2.28.2+1
[14a3606d] MozillaCACerts_jll v2023.1.10
[4536629a] OpenBLAS_jll v0.3.23+2
[bea87d4a] SuiteSparse_jll v7.2.1+1
[83775a58] Zlib_jll v1.2.13+1
[8e850b90] libblastrampoline_jll v5.8.0+1
[8e850ede] nghttp2_jll v1.52.0+1

Iā€™m actually more interested in what else is in your environment.

1 Like

Sure, what info are you interested in?

Is that the full output of pkg"status"?

1 Like

Iā€™m afraid this is the full output of the two command pkg"status" and pkg"status -m"

I do not see MKL loaded on the Julia side, but perhaps there is another issue. Could you try PythonPlot.jl?

Played with the code this morning and with PythonPlot there is no exception and graphs are being output as eaxpected. Thank you! :ok_hand:

1 Like

I got the same error messages after doing Conda.update(). (Worked fine until then.)

In the end, the only way to get around it was to ditch Conda and instead define ENV["PYTHON"] to point to the Anaconda distribution (which has always existed on this machine).