7

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?

user3576751
  • 79
  • 1
  • 5
  • Possible duplicate of [What does \`Fatal Python error: PyThreadState\_Get: no current thread\` mean?](http://stackoverflow.com/questions/35640529/what-does-fatal-python-error-pythreadstate-get-no-current-thread-mean) – fish2000 Sep 08 '16 at 20:41

1 Answers1

0

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/

user3576751
  • 79
  • 1
  • 5
  • 3
    Actually one should **NOT** follow the directions in the linked article – he recommends deleting Apple system components (e.g. `/usr/bin/python` and stuff in `/System/Library/Frameworks`) which is _always a terrible idea_ and will cause lots of hard-to-diagnose problems. Personally I recommend installing Python with [Homebrew](http://brew.sh/) and going from there. But _do not delete Apple software bundles…_ doing so will mess up your life unnecessarily when you have to somehow fix it, guaranteed! – fish2000 Sep 08 '16 at 20:38