PyPlot installation error related to libpython3.7m.dylib and libsystem_kernel.dylib

Hello,

I am trying to install PyPlot on the latest version of Julia (1.0) but I am getting the error below.

Note that this is a brand new installation of Julia. I made sure I deleted .julia folder before I performed the commands below. The exact line of commands that I am using are below.

This is a rather cumbersome error. Could someone help me to understand what could be going wrong ?

Thank you so much in advance,
Josimar

ENV[“PYTHON”]=“”
Pkg.add(“PyCall”)
Pkg.add(“PyPlot”)

using PyCall
pygui(:tk)
using PyPlot
pygui(true)

figure(“Test”)
clf()
plot(rand(10))

2018-11-17 10:36:05.109 julia[26233:13583963] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7f91c0d55380
2018-11-17 10:36:05.111 julia[26233:13583963] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[NSApplication _setup:]: unrecognized selector sent to instance 0x7f91c0d55380’
*** First throw call stack:
(
0 CoreFoundation 0x00007fff32a7c32b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fff5a0f6c76 objc_exception_throw + 48
2 CoreFoundation 0x00007fff32b14e04 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00007fff329f2870 forwarding + 1456
4 CoreFoundation 0x00007fff329f2238 _CF_forwarding_prep_0 + 120
5 libtk8.6.dylib 0x000000013a76331d TkpInit + 413
6 libtk8.6.dylib 0x000000013a6bb17e Initialize + 2622
7 _tkinter.cpython-37m-darwin.so 0x000000013a4e3a0f _tkinter_create + 1183
8 libpython3.7m.dylib 0x000000012898c2b9 _PyMethodDef_RawFastCallKeywords + 681
9 libpython3.7m.dylib 0x000000012898c3bd _PyCFunction_FastCallKeywords + 45
10 libpython3.7m.dylib 0x0000000128a95c4b call_function + 603
11 libpython3.7m.dylib 0x0000000128a8ce45 _PyEval_EvalFrameDefault + 7893
12 libpython3.7m.dylib 0x0000000128a8aad9 _PyEval_EvalCodeWithName + 3305
13 libpython3.7m.dylib 0x000000012898b1b1 _PyFunction_FastCallDict + 481
14 libpython3.7m.dylib 0x000000012898cba4 _PyObject_Call_Prepend + 164
15 libpython3.7m.dylib 0x00000001289f45aa slot_tp_init + 298
16 libpython3.7m.dylib 0x00000001289fdca7 type_call + 295
17 libpython3.7m.dylib 0x000000012898be73 _PyObject_FastCallKeywords + 691
18 libpython3.7m.dylib 0x0000000128a95cb4 call_function + 708
19 libpython3.7m.dylib 0x0000000128a8cf6c _PyEval_EvalFrameDefault + 8188
20 libpython3.7m.dylib 0x000000012898ba6e function_code_fastcall + 254
21 libpython3.7m.dylib 0x0000000128a95cbe call_function + 718
22 libpython3.7m.dylib 0x0000000128a8ce45 _PyEval_EvalFrameDefault + 7893
23 libpython3.7m.dylib 0x0000000128a8aad9 _PyEval_EvalCodeWithName + 3305
24 libpython3.7m.dylib 0x000000012898b1b1 _PyFunction_FastCallDict + 481
25 libpython3.7m.dylib 0x000000012898cba4 _PyObject_Call_Prepend + 164
26 libpython3.7m.dylib 0x000000012898e5b4 method_call + 36
27 libpython3.7m.dylib 0x000000012898c5b6 PyObject_Call + 246
28 libpython3.7m.dylib 0x0000000128a8d1b5 _PyEval_EvalFrameDefault + 8773
29 libpython3.7m.dylib 0x0000000128a8aad9 _PyEval_EvalCodeWithName + 3305
30 libpython3.7m.dylib 0x000000012898b1b1 _PyFunction_FastCallDict + 481
31 ??? 0x000000012889351a 0x0 + 4975047962
32 ??? 0x00000001288937ab 0x0 + 4975048619
33 ??? 0x00000001288c0886 0x0 + 4975233158
34 ??? 0x00000001288c0732 0x0 + 4975232818
35 libjulia.1.0.dylib 0x000000010445960c eval_body + 1228
36 libjulia.1.0.dylib 0x0000000104459b58 jl_interpret_toplevel_thunk_callback + 408
37 libjulia.1.0.dylib 0x00000001042ac76c enter_interpreter_frame + 28
38 libjulia.1.0.dylib 0x00000001042c68bd jl_toplevel_eval_flex + 1533
39 libjulia.1.0.dylib 0x00000001042a1f9f jl_parse_eval_all + 1279
40 ??? 0x0000000128900cf8 0x0 + 4975496440
)
libc++abi.dylib: terminating with uncaught exception of type NSException

signal (6): Abort trap: 6
in expression starting at Install.jl:16
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
Allocations: 99120603 (Pool: 99098775; Big: 21828); GC: 223

FYI: PSA: how to quote code with backticks

This looks like PyPlot crashes Julia 1.0.1 on macOS Mojave · Issue #405 · JuliaPy/PyPlot.jl · GitHub. You can workaround the issue by using Qt5Agg backend:
https://github.com/JuliaPy/PyPlot.jl/issues/405#issuecomment-436134944
https://github.com/JuliaPy/PyPlot.jl/issues/399#issuecomment-430592493