Code Monkey home page Code Monkey logo

Comments (12)

vberthiaume avatar vberthiaume commented on August 23, 2024 7

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')

from sms-tools.

rzagni avatar rzagni commented on August 23, 2024 4

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')_

from sms-tools.

ValeryToda avatar ValeryToda commented on August 23, 2024 2

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.

from sms-tools.

rynkadink avatar rynkadink commented on August 23, 2024 1

Thanks, that did the trick!!

from sms-tools.

stella-lu avatar stella-lu commented on August 23, 2024 1

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.

from sms-tools.

rzagni avatar rzagni commented on August 23, 2024

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 ?

from sms-tools.

dandrievsky avatar dandrievsky commented on August 23, 2024

The fix also works for 10.10.5

from sms-tools.

pinheadmz avatar pinheadmz commented on August 23, 2024

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

from sms-tools.

gaoyangyiqiao avatar gaoyangyiqiao commented on August 23, 2024

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

from sms-tools.

ayjayt avatar ayjayt commented on August 23, 2024

from sms-tools.

gaoyangyiqiao avatar gaoyangyiqiao commented on August 23, 2024

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

from sms-tools.

ddavilam avatar ddavilam commented on August 23, 2024

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

from sms-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.