16

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?

2
  • 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. However, the animation which I expected and works on Windows, does not appear, it only appears a black window.
    – jl.da
    Jun 18, 2014 at 15:16
  • 1
    I think it would be great to update the main question with this info and close this question. Then people know what to do if they run into it. Regarding the animation not working, you could post a new question on that specifically, of course posting a short code which replicates the error (works on Windows but not on mac). Jun 18, 2014 at 17:40

5 Answers 5

13

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

1
  • This is exactly what I needed to find out what was causing the problem for me. I was still getting these aborts even though I tried using brew to switch my openssl versions. It is also funny to see my problem also stems from the asn1crypto package. Jun 12, 2020 at 20:49
12

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
3
  • 3
    when you say "pip3 install --upgrade packagname" what kind of packagename are you talking about?
    – Meyben
    May 20, 2020 at 6:29
  • pip3 install --upgrade pyopenssl ?
    – Zinovy Nis
    May 27, 2020 at 14:54
  • I was facing the same issue since I've updated my mac OS to Catalina. I just followed the steps here and didn't do the last one (pip install) and everything works fine for me now Jan 14, 2021 at 19:12
1

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.

3
  • 1
    You haven't told us what you mean by using a "pyglet animation" nor the way in which it "doesn't work". We can't help you with so little detail. Code and/or error information is essential to get any useful answer
    – Jon
    Jun 20, 2014 at 10:37
  • @Jon, I have posted another question regarding the animation, thank you for your feedback.
    – jl.da
    Jun 20, 2014 at 10:41
  • 1
    Have you tried changing your matplotlib backed to TkAgg? matplotlib.use('TkAgg')
    – Atul Ingle
    Jun 15, 2016 at 15:40
0

The error message doesn't tell us very much in this case. What you need to do (in debugging in general) is work out what succeeds and what fails in order to narrow down the problem.

Start with a script that just imports pyglet. If that works then import pyglet and open a window etc...

Report back when you know what line causes the error to occur.

Jon

1
  • thanks for the answer. I have finally found why this error appeared. It is because I use TKinter, when I comment out the lines where this library is used, the error does not appear. However, the animation that I expected and works on Windows does not appear. Therefore I will follow your advice and start a simple script.
    – jl.da
    Jun 18, 2014 at 15:17
0

I was getting the same failure on importing asn1crypto in Python (on MacOS 10.15.5). Uninstalling then re-installing openssl using brew worked for me:

brew uninstall --ignore-dependencies openssl

brew warned me that there were some files remaining which were not deleted (e.g. /usr/local/etc/[email protected]/cert.pem) which I moved to a backup location:

sudo mv /usr/local/etc/[email protected] ~/[email protected]

Then reinstalling openssl using brew cured the problem:

brew install openssl

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.