Swig Fatal Python error: PyThreadState_Get: no current thread Abort trap: 6 with Python 2.7.5

user3576751 picture user3576751 · Apr 26, 2014 · Viewed 9.2k times · Source

Before I upgraded Python I used Python 2.7.2 and there was no problem with Swig when I imported the generated dynamic library my_lib into a python file.

Now with Python 2.7.5 I can generate the dynamic library my_lib with Swig but when I import this library in a python file I receive:

Fatal Python error: PyThreadState_Get: no current thread Abort trap: 6

With that crash report:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread

0____libsystem_kernel.dylib________0x00007fff897c2212 __pthread_kill + 10

1_____libsystem_c.dylib____________0x00007fff8b5c9b24 pthread_kill + 90

2_____libsystem_c.dylib____________0x00007fff8b60df61 abort + 143

My python path interpreter is:

/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python

An other important thing I noticed in the report is:

libmylib.so ----------0x1004c3000 - -----------0x1005d0fff---org.python.python (2.7.2 - 2.7.2) -/System/Library/Frameworks/Python.framework/Versions/2.7/Python

What can I do?

Answer

user3576751 picture user3576751 · Apr 29, 2014

My python interpreter is the version 2.7.5 and when I executed the command line /usr/bin/python, it launched the version 2.7.2 this is why I had a problem.

I found the solution reading this article:

http://wolfpaulus.com/jounal/mac/installing_python_osx/