Skip to content
This repository was archived by the owner on Nov 5, 2025. It is now read-only.

Conversation

@jselsing
Copy link

In the latest version of matplotlib, I need to set the backend explicitely to avoid crash. I have added this small explicit backend call to fcmaker.py and fcmaker_plots.py. I don't know if this is a general problem, or something with my machine. Just ignore this, if it works for others. Additionally, my editor has removed trailing whitespaces, but that should not make a difference.

In the latest version of matplotlib, I need to set the backend explicitely to avoid crash. I have added this small call to fcmaker.py and fcmaker_plots.py. Additionally, my editor has remove trailing whitespaces.
@fpavogt
Copy link
Owner

fpavogt commented Nov 12, 2018

Hi @jselsing ... backend troubles can be tricky. That's why I've avoided to set one directly inside the code, since I was not sure how this might affect users. In fact, the matplotlib docs suggest to avoid to hard-code a specific backend via matplotlib.use(), unless absolutely necessary.

I would rather give users the ability to specify the backend as an additional fcmaker argument. Still, before adding yet another parameters (I'm trying to keep their numbers low), I'm curious about the error you get, since it has not been reported before. Would you be able to create a new issue describing the error message you are getting, alongside the python/matplotlib version and operating system you are using ? I'd be keen to dig a bit in the code to see if doing things differently could improve things, and avoid having to force the backend upon the user.

Having a dedicated issue open would also be useful for other users that might have the same problem.

Thanks !

@jselsing
Copy link
Author

Awesome source, that makes sense! I guess in reality, this should be bug report for Matplotlib, not here. I will submit another issue to the Matplotlib people.

I'm on a mac with macOS Mojave version 10.14.1 and I use python 3.6 with

matplotlib 3.0.1 1 conda-forge

installed through Conda.

without setting the backend with import matplotlib; matplotlib.use('TkAgg'), the script crashes with the following error message. The error-message is really obscure, so it does not help me a lot.

2018-11-12 14:18:06.422 python[91048:1938705] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7fbee7bc7350
2018-11-12 14:18:06.426 python[91048:1938705] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7fbee7bc7350'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff31af8e65 __exceptionPreprocess + 256
1 libobjc.A.dylib 0x00007fff5db53720 objc_exception_throw + 48
2 CoreFoundation 0x00007fff31b7622d -[NSObject(NSObject) __retain_OA] + 0
3 CoreFoundation 0x00007fff31a9a820 forwarding + 1486
4 CoreFoundation 0x00007fff31a9a1c8 _CF_forwarding_prep_0 + 120
5 libtk8.6.dylib 0x000000011cdeb295 TkpInit + 408
6 libtk8.6.dylib 0x000000011cd5b69a Initialize + 2457
7 _tkinter.cpython-36m-darwin.so 0x000000011cbbbda4 Tcl_AppInit + 84
8 _tkinter.cpython-36m-darwin.so 0x000000011cbbba7b _tkinter_create + 1115
9 libpython3.6m.dylib 0x0000000108a9ba1b _PyCFunction_FastCallDict + 491
10 libpython3.6m.dylib 0x0000000108b1f6c7 call_function + 439
11 libpython3.6m.dylib 0x0000000108b1c038 _PyEval_EvalFrameDefault + 25080
12 libpython3.6m.dylib 0x0000000108b2050c _PyEval_EvalCodeWithName + 3436
13 libpython3.6m.dylib 0x0000000108b2122b _PyFunction_FastCallDict + 891
14 libpython3.6m.dylib 0x0000000108a4fa53 _PyObject_FastCallDict + 307
15 libpython3.6m.dylib 0x0000000108a4fb75 _PyObject_Call_Prepend + 149
16 libpython3.6m.dylib 0x0000000108a4f811 PyObject_Call + 97
17 libpython3.6m.dylib 0x0000000108ab3d0d slot_tp_init + 125
18 libpython3.6m.dylib 0x0000000108ab0009 type_call + 313
19 libpython3.6m.dylib 0x0000000108a4fa21 _PyObject_FastCallDict + 257
20 libpython3.6m.dylib 0x0000000108a4fe65 _PyObject_FastCallKeywords + 197
21 libpython3.6m.dylib 0x0000000108b1f5c8 call_function + 184
22 libpython3.6m.dylib 0x0000000108b1c0c8 _PyEval_EvalFrameDefault + 25224
23 libpython3.6m.dylib 0x0000000108b20de8 fast_function + 488
24 libpython3.6m.dylib 0x0000000108b1f6a1 call_function + 401
25 libpython3.6m.dylib 0x0000000108b1c038 _PyEval_EvalFrameDefault + 25080
26 libpython3.6m.dylib 0x0000000108b2050c _PyEval_EvalCodeWithName + 3436
27 libpython3.6m.dylib 0x0000000108b2122b _PyFunction_FastCallDict + 891
28 libpython3.6m.dylib 0x0000000108a4fa53 _PyObject_FastCallDict + 307
29 libpython3.6m.dylib 0x0000000108a4fb75 _PyObject_Call_Prepend + 149
30 libpython3.6m.dylib 0x0000000108a4f811 PyObject_Call + 97
31 libpython3.6m.dylib 0x0000000108b1c294 _PyEval_EvalFrameDefault + 25684
32 libpython3.6m.dylib 0x0000000108b2050c _PyEval_EvalCodeWithName + 3436
33 libpython3.6m.dylib 0x0000000108b20e91 fast_function + 657
34 libpython3.6m.dylib 0x0000000108b1f6a1 call_function + 401
35 libpython3.6m.dylib 0x0000000108b1c038 _PyEval_EvalFrameDefault + 25080
36 libpython3.6m.dylib 0x0000000108b20de8 fast_function + 488
37 libpython3.6m.dylib 0x0000000108b1f6a1 call_function + 401
38 libpython3.6m.dylib 0x0000000108b1c038 _PyEval_EvalFrameDefault + 25080
39 libpython3.6m.dylib 0x0000000108b2050c _PyEval_EvalCodeWithName + 3436
40 libpython3.6m.dylib 0x0000000108b20e91 fast_function + 657
41 libpython3.6m.dylib 0x0000000108b1f6a1 call_function + 401
42 libpython3.6m.dylib 0x0000000108b1c038 _PyEval_EvalFrameDefault + 25080
43 libpython3.6m.dylib 0x0000000108b2050c _PyEval_EvalCodeWithName + 3436
44 libpython3.6m.dylib 0x0000000108b20e91 fast_function + 657
45 libpython3.6m.dylib 0x0000000108b1f6a1 call_function + 401
46 libpython3.6m.dylib 0x0000000108b1c0c8 _PyEval_EvalFrameDefault + 25224
47 libpython3.6m.dylib 0x0000000108b20de8 fast_function + 488
48 libpython3.6m.dylib 0x0000000108b1f6a1 call_function + 401
49 libpython3.6m.dylib 0x0000000108b1c038 _PyEval_EvalFrameDefault + 25080
50 libpython3.6m.dylib 0x0000000108b2050c _PyEval_EvalCodeWithName + 3436
51 libpython3.6m.dylib 0x0000000108b15d74 PyEval_EvalCode + 100
52 libpython3.6m.dylib 0x0000000108b4b841 PyRun_FileExFlags + 209
53 libpython3.6m.dylib 0x0000000108b4b0ee PyRun_SimpleFileExFlags + 846
54 libpython3.6m.dylib 0x0000000108b64ab6 Py_Main + 3526
55 python 0x0000000108688df8 main + 232
56 libdyld.dylib 0x00007fff5ec2208d start + 1
57 ??? 0x0000000000000003 0x0 + 3
)
libc++abi.dylib: terminating with uncaught exception of type NSException
[Finished in 1.9s with exit code -6]

@jselsing jselsing mentioned this pull request Nov 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants