I am working on a python program that displays an animation, thus I am using pyglet. Until now I've been working with the python compiler that comes with Psychopy, but now I need to make this program as most independent as possible.
I have achieved this task with a Windows machine, in the case of OSX, I have followed this post in order to install pyglet. However, when I now run the program, it returns this:
>>>> python 140603_plaid8.py
2014-06-17 12:25:02.512 Python[1713:d07] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/fk/1plt8wj53_d183pv59scmg4m0000gn/T/org.python.python.savedState
no input received
CONFIG FILE LOADED
TRIALS FILE LOADED
2014-06-17 12:25:02.661 Python[1713:d07] -[NSApplication _setup:]: unrecognized selector sent to instance 0x102d3b5c0
2014-06-17 12:25:02.662 Python[1713:d07] An uncaught exception was raised
2014-06-17 12:25:02.663 Python[1713:d07] -[NSApplication _setup:]: unrecognized selector sent to instance 0x102d3b5c0
2014-06-17 12:25:02.663 Python[1713:d07] (
0 CoreFoundation 0x00007fff8948f25c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff87f16e75 objc_exception_throw + 43
2 CoreFoundation 0x00007fff8949212d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff893ed322 ___forwarding___ + 1010
4 CoreFoundation 0x00007fff893ecea8 _CF_forwarding_prep_0 + 120
5 Tk 0x0000000108253ed6 TkpInit + 459
6 Tk 0x00000001081d1b0f Tk_Init + 1687
7 _tkinter.so 0x00000001080b4c0d Tcl_AppInit + 77
8 _tkinter.so 0x00000001080b3657 Tkinter_Create + 919
9 Python 0x00000001000c2fad PyEval_EvalFrameEx + 21405
10 Python 0x00000001000c4fb3 PyEval_EvalCodeEx + 2115
11 Python 0x000000010003eac0 function_call + 176
12 Python 0x000000010000ceb2 PyObject_Call + 98
13 Python 0x000000010001f56d instancemethod_call + 365
14 Python 0x000000010000ceb2 PyObject_Call + 98
15 Python 0x00000001000bc957 PyEval_CallObjectWithKeywords + 87
16 Python 0x000000010002285e PyInstance_New + 126
17 Python 0x000000010000ceb2 PyObject_Call + 98
18 Python 0x00000001000c0c60 PyEval_EvalFrameEx + 12368
19 Python 0x00000001000c4fb3 PyEval_EvalCodeEx + 2115
20 Python 0x000000010003eac0 function_call + 176
21 Python 0x000000010000ceb2 PyObject_Call + 98
22 Python 0x000000010001f56d instancemethod_call + 365
23 Python 0x000000010000ceb2 PyObject_Call + 98
24 Python 0x00000001000bc957 PyEval_CallObjectWithKeywords + 87
25 Python 0x000000010002285e PyInstance_New + 126
26 Python 0x000000010000ceb2 PyObject_Call + 98
27 Python 0x00000001000c0c60 PyEval_EvalFrameEx + 12368
28 Python 0x00000001000c4fb3 PyEval_EvalCodeEx + 2115
29 Python 0x00000001000c50d6 PyEval_EvalCode + 54
30 Python 0x00000001000e995e PyRun_FileExFlags + 174
31 Python 0x00000001000e9bfa PyRun_SimpleFileExFlags + 458
32 Python 0x0000000100100c0d Py_Main + 3101
33 Python 0x0000000100000f14 Python + 3860
34 ??? 0x0000000000000002 0x0 + 2
)
2014-06-17 12:25:02.664 Python[1713:d07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x102d3b5c0'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff8948f25c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff87f16e75 objc_exception_throw + 43
2 CoreFoundation 0x00007fff8949212d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff893ed322 ___forwarding___ + 1010
4 CoreFoundation 0x00007fff893ecea8 _CF_forwarding_prep_0 + 120
5 Tk 0x0000000108253ed6 TkpInit + 459
6 Tk 0x00000001081d1b0f Tk_Init + 1687
7 _tkinter.so 0x00000001080b4c0d Tcl_AppInit + 77
8 _tkinter.so 0x00000001080b3657 Tkinter_Create + 919
9 Python 0x00000001000c2fad PyEval_EvalFrameEx + 21405
10 Python 0x00000001000c4fb3 PyEval_EvalCodeEx + 2115
11 Python 0x000000010003eac0 function_call + 176
12 Python 0x000000010000ceb2 PyObject_Call + 98
13 Python 0x000000010001f56d instancemethod_call + 365
14 Python 0x000000010000ceb2 PyObject_Call + 98
15 Python 0x00000001000bc957 PyEval_CallObjectWithKeywords + 87
16 Python 0x000000010002285e PyInstance_New + 126
17 Python 0x000000010000ceb2 PyObject_Call + 98
18 Python 0x00000001000c0c60 PyEval_EvalFrameEx + 12368
19 Python 0x00000001000c4fb3 PyEval_EvalCodeEx + 2115
20 Python 0x000000010003eac0 function_call + 176
21 Python 0x000000010000ceb2 PyObject_Call + 98
22 Python 0x000000010001f56d instancemethod_call + 365
23 Python 0x000000010000ceb2 PyObject_Call + 98
24 Python 0x00000001000bc957 PyEval_CallObjectWithKeywords + 87
25 Python 0x000000010002285e PyInstance_New + 126
26 Python 0x000000010000ceb2 PyObject_Call + 98
27 Python 0x00000001000c0c60 PyEval_EvalFrameEx + 12368
28 Python 0x00000001000c4fb3 PyEval_EvalCodeEx + 2115
29 Python 0x00000001000c50d6 PyEval_EvalCode + 54
30 Python 0x00000001000e995e PyRun_FileExFlags + 174
31 Python 0x00000001000e9bfa PyRun_SimpleFileExFlags + 458
32 Python 0x0000000100100c0d Py_Main + 3101
33 Python 0x0000000100000f14 Python + 3860
34 ??? 0x0000000000000002 0x0 + 2
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6
I do not understand what this error means, can anyone help me understand what have I done wrong?
I faced a similar error while using OpenCV. After googling for a while I found out that the error might be with the new macOS. It does not allow un-versioned dylibs to be called. I found the solution here:
https://forums.developer.apple.com/thread/119429
In your terminal:
brew update && brew upgrade && brew install openssl
cd /usr/local/Cellar/openssl/1.0.2t/lib
sudo cp libssl.1.0.0.dylib libcrypto.1.0.0.dylib /usr/local/lib/
cd /usr/local/lib
sudo ln -s libssl.1.0.0.dylib libssl.dylib
sudo ln -s libcrypto.1.0.0.dylib libcrypto.dylib
pip3 install --upgrade packagename
Run your Python script like this:
$ PYTHONVERBOSE=3 python your_script.py
Check the last statement before Abort trap: 6
, such as:
import asn1crypto._perf._big_num_ctypes # precompiled from ...
Abort trap: 6
Then, run it in a standalone Python interpreter:
$ python
Python 2.7.17 (default, May 6 2020, 10:47:56)
[GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.32.59)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import asn1crypto._perf._big_num_ctypes
Abort trap: 6
Then you know that the problem is originated from the asn1crypto
module, in this case. Dig into that file and find more...
But for this particular case, just delete the directory of asn1crypto
package and try again. (pip uninstall asn1crypto
may not work.)
I have found the reason why this error appears. It is because I use the library TKinter, if I comment out the lines where I use TKinter, this error does not appear and it continues to execute the program.
I will edit this answer when I discover which is the proper way to use TKinter in OSX. But my main concern first is the pyglet animation, which does not work in OSX, but it does in Windows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With