Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run models_interface.py on OSX 10.11 #33

Closed
notno opened this issue May 1, 2016 · 12 comments
Closed

Can't run models_interface.py on OSX 10.11 #33

notno opened this issue May 1, 2016 · 12 comments

Comments

@notno
Copy link

notno commented May 1, 2016

I was able to compile with python compileModule.py build_ext --inplace.

I get this error:

2016-05-01 12:09:49.067 Python[39914:2885834] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7f9d2307e870'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff900bf4f2 __exceptionPreprocess + 178
    1   libobjc.A.dylib                     0x00007fff8d432f7e objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff901291ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x00007fff9002f571 ___forwarding___ + 1009
    4   CoreFoundation                      0x00007fff9002f0f8 _CF_forwarding_prep_0 + 120
    5   Tk                                  0x0000000102c69948 TkpInit + 476
    6   Tk                                  0x0000000102be4a6e Tk_Init + 1799
    7   _tkinter.so                         0x0000000102ac4ced Tcl_AppInit + 82
    8   _tkinter.so                         0x0000000102ac04b8 Tkinter_Create + 1084
    9   Python                              0x00000001025369af PyEval_EvalFrameEx + 14722
    10  Python                              0x0000000102532df9 PyEval_EvalCodeEx + 1412
    11  Python                              0x00000001024d731c function_call + 350
    12  Python                              0x00000001024b93b6 PyObject_Call + 99
    13  Python                              0x00000001024c41a5 instancemethod_call + 174
    14  Python                              0x00000001024b93b6 PyObject_Call + 99
    15  Python                              0x0000000102538d9b PyEval_CallObjectWithKeywords + 93
    16  Python                              0x00000001024c241f PyInstance_New + 126
    17  Python                              0x00000001024b93b6 PyObject_Call + 99
    18  Python                              0x0000000102535e8c PyEval_EvalFrameEx + 11871
    19  Python                              0x0000000102532df9 PyEval_EvalCodeEx + 1412
    20  Python                              0x000000010253286f PyEval_EvalCode + 54
    21  Python                              0x0000000102552a2a run_mod + 53
    22  Python                              0x0000000102552acd PyRun_FileExFlags + 133
    23  Python                              0x000000010255266a PyRun_SimpleFileExFlags + 769
    24  Python                              0x0000000102563d6f Py_Main + 3051
    25  libdyld.dylib                       0x00007fff9c17b5ad start + 1
    26  ???                                 0x0000000000000002 0x0 + 2
)
libc++abi.dylib: terminating with uncaught exception of type NSException
zsh: abort      python models_GUI.py
@rzagni
Copy link

rzagni commented May 25, 2016

I'm experiencing the issue while invoking python transformations_GUI.py and python models_GUI.py on Mac OS 10.11

rzagni$ python transformations_GUI.py
2016-05-24 17:16:00.820 Python[7056:79255] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7fc74d0ad080
2016-05-24 17:16:00.821 Python[7056:79255] An uncaught exception was raised
2016-05-24 17:16:00.821 Python[7056:79255] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7fc74d0ad080
2016-05-24 17:16:00.821 Python[7056:79255] (
0 CoreFoundation 0x00007fff85ada4f2 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff8ca7b73c objc_exception_throw + 48
2 CoreFoundation 0x00007fff85b441ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff85a4a571 forwarding + 1009
4 CoreFoundation 0x00007fff85a4a0f8 _CF_forwarding_prep_0 + 120
5 Tk 0x000000010d873948 TkpInit + 476
6 Tk 0x000000010d7eea6e Tk_Init + 1799
7 _tkinter.so 0x000000010d6ceb9d Tcl_AppInit + 82
8 _tkinter.so 0x000000010d6ce547 Tkinter_Create + 1120
9 Python 0x000000010d17bbcd PyEval_EvalFrameEx + 26858
10 Python 0x000000010d1750f1 PyEval_EvalCodeEx + 1583
11 Python 0x000000010d119fb1 function_call + 352
12 Python 0x000000010d0fbeb0 PyObject_Call + 99
13 Python 0x000000010d106cb8 instancemethod_call + 173
14 Python 0x000000010d0fbeb0 PyObject_Call + 99
15 Python 0x000000010d17f06f PyEval_CallObjectWithKeywords + 165
16 Python 0x000000010d104f5c PyInstance_New + 126
17 Python 0x000000010d0fbeb0 PyObject_Call + 99
18 Python 0x000000010d17ba27 PyEval_EvalFrameEx + 26436
19 Python 0x000000010d1750f1 PyEval_EvalCodeEx + 1583
20 Python 0x000000010d174abc PyEval_EvalCode + 54
21 Python 0x000000010d198ea1 run_mod + 53
22 Python 0x000000010d198f44 PyRun_FileExFlags + 133
23 Python 0x000000010d198a93 PyRun_SimpleFileExFlags + 698
24 Python 0x000000010d1aa445 Py_Main + 3137
25 libdyld.dylib 0x00007fff8bffc5ad start + 1
)
2016-05-24 17:16:00.821 Python[7056:79255] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7fc74d0ad080'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff85ada4f2 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff8ca7b73c objc_exception_throw + 48
2 CoreFoundation 0x00007fff85b441ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff85a4a571 forwarding + 1009
4 CoreFoundation 0x00007fff85a4a0f8 _CF_forwarding_prep_0 + 120
5 Tk 0x000000010d873948 TkpInit + 476
6 Tk 0x000000010d7eea6e Tk_Init + 1799
7 _tkinter.so 0x000000010d6ceb9d Tcl_AppInit + 82
8 _tkinter.so 0x000000010d6ce547 Tkinter_Create + 1120
9 Python 0x000000010d17bbcd PyEval_EvalFrameEx + 26858
10 Python 0x000000010d1750f1 PyEval_EvalCodeEx + 1583
11 Python 0x000000010d119fb1 function_call + 352
12 Python 0x000000010d0fbeb0 PyObject_Call + 99
13 Python 0x000000010d106cb8 instancemethod_call + 173
14 Python 0x000000010d0fbeb0 PyObject_Call + 99
15 Python 0x000000010d17f06f PyEval_CallObjectWithKeywords + 165
16 Python 0x000000010d104f5c PyInstance_New + 126
17 Python 0x000000010d0fbeb0 PyObject_Call + 99
18 Python 0x000000010d17ba27 PyEval_EvalFrameEx + 26436
19 Python 0x000000010d1750f1 PyEval_EvalCodeEx + 1583
20 Python 0x000000010d174abc PyEval_EvalCode + 54
21 Python 0x000000010d198ea1 run_mod + 53
22 Python 0x000000010d198f44 PyRun_FileExFlags + 133
23 Python 0x000000010d198a93 PyRun_SimpleFileExFlags + 698
24 Python 0x000000010d1aa445 Py_Main + 3137
25 libdyld.dylib 0x00007fff8bffc5ad start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6

Had anybody faced and resolved this problem ?

@rzagni
Copy link

rzagni commented May 25, 2016

Found the fix in another thread

flothesof commented on Feb 8
_This can be solved by adding these two lines to models_GUI.py

import matplotlib
matplotlib.use('TkAgg')_

@vberthiaume
Copy link

vberthiaume commented Jul 6, 2016

I had the same problem as @rzagni and fixed it using the same solution, minus the '_' ;). Add these 2 lines at the very top of models_GUI.py:

import matplotlib
matplotlib.use('TkAgg')

@ValeryToda
Copy link

I found a fix here. I had to insert the following lines:

from sys import platform as sys_pf
if sys_pf == 'darwin':
    import matplotlib
    matplotlib.use("TkAgg")

at the top of the file

sms-tools/software/models_interface/models_GUI.py

to get rid of the crash.

@rynkadink
Copy link

Thanks, that did the trick!!

@dandrievsky
Copy link

The fix also works for 10.10.5

@pinheadmz
Copy link

This worked for me on both transformations_GUI.py and models_GUI.py!

@gaoyangyiqiao
Copy link

This didn't work for me .I don't know why..Is any help?

@ayjayt
Copy link

ayjayt commented Sep 28, 2017 via email

@gaoyangyiqiao
Copy link

I run this first: from matpllotlib import pyplot as ply and it occured like this:
Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.

then I add this two lines on the top as above: import matplotlib matplotlib.use('TkAgg'),and then it occured like below:

python[54449:2274888] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7fe8a80cdf50
2017-09-28 21:45:40.283 python[54449:2274888] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7fe8a80cdf50'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff75e1257b __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x00007fff8b06b1da objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff75e92f14 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x00007fff75d85c93 ___forwarding___ + 1059
	4   CoreFoundation                      0x00007fff75d857e8 _CF_forwarding_prep_0 + 120
	5   Tk                                  0x0000000103e4fc02 TkpInit + 471
	6   Tk                                  0x0000000103dcb2a9 Tk_Init + 1794
	7   _tkinter.so                         0x0000000103ca5bcd Tcl_AppInit + 82
	8   _tkinter.so                         0x0000000103ca5574 init_tkinter + 20866
	9   Python                              0x0000000101c0f4d4 PyEval_EvalFrameEx + 14624
	10  Python                              0x0000000101c0b9be PyEval_EvalCodeEx + 1617
	11  Python                              0x0000000101bb14d1 PyFunction_SetClosure + 826
	12  Python                              0x0000000101b936fb PyObject_Call + 99
	13  Python                              0x0000000101b9e3ac PyMethod_New + 1221
	14  Python                              0x0000000101b936fb PyObject_Call + 99
	15  Python                              0x0000000101c11dbb PyEval_CallObjectWithKeywords + 165
	16  Python                              0x0000000101b9c627 PyInstance_New + 126
	17  Python                              0x0000000101b936fb PyObject_Call + 99
	18  Python                              0x0000000101c0e78b PyEval_EvalFrameEx + 11223
	19  Python                              0x0000000101c0b9be PyEval_EvalCodeEx + 1617
	20  Python                              0x0000000101c123e2 _PyEval_SliceIndex + 338
	21  Python                              0x0000000101c0ee4e PyEval_EvalFrameEx + 12954
	22  Python                              0x0000000101c0b9be PyEval_EvalCodeEx + 1617
	23  Python                              0x0000000101bb14d1 PyFunction_SetClosure + 826
	24  Python                              0x0000000101b936fb PyObject_Call + 99
	25  Python                              0x0000000101c0efe5 PyEval_EvalFrameEx + 13361
	26  Python                              0x0000000101c0b9be PyEval_EvalCodeEx + 1617
	27  Python                              0x0000000101c123e2 _PyEval_SliceIndex + 338
	28  Python                              0x0000000101c0ee4e PyEval_EvalFrameEx + 12954
	29  Python                              0x0000000101c0b9be PyEval_EvalCodeEx + 1617
	30  Python                              0x0000000101c0b367 PyEval_EvalCode + 48
	31  Python                              0x0000000101c2b5dd PyParser_ASTFromFile + 297
	32  Python                              0x0000000101c2b680 PyRun_FileExFlags + 133
	33  Python                              0x0000000101c2b1d1 PyRun_SimpleFileExFlags + 702
	34  Python                              0x0000000101c3cb6a Py_Main + 3094
	35  libdyld.dylib                       0x00007fff8b94c235 start + 1
	36  ???                                 0x0000000000000004 0x0 + 4
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6

@xserra xserra closed this as completed Feb 14, 2018
@stella-lu
Copy link

From the documentation:

This function must be called before importing pyplot for the first time; or, if you are not using pyplot, it must be called before importing matplotlib.backends.

You need to use
import matplotlib matplotlib.use('TkAgg')
before importing pyplot.

@ddavilam
Copy link

ddavilam commented Oct 1, 2018

In which directory of macOS can I find models_GUI.py, I not find it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests