Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does `Fatal Python error: PyThreadState_Get: no current thread` mean?

I am passing an mpi communicator from python to C. I chose to use boost's mpi communicator as mpi4py does not seem to have good C support. Check it out:

        try: from boost.mpi import world
        except ImportError: from mpi import world
        err = run_with_mpi(infile, world, stdout, stderr, exc)

On systems where boost.mpi is installed, this raises no errors. However, boost.mpi cannot be installed on mac. I installed boost's mpi.so module using homebrew's boost155 formula then added the .so file to pythonpath.

Generally, what does Fatal Python error: PyThreadState_Get: no current thread mean? What clues does this message give to developers like myself?

Full error message:

Fatal Python error: PyThreadState_Get: no current thread
[kilojoules-20160s:64471] *** Process received signal ***
[kilojoules-20160s:64471] Signal: Abort trap: 6 (6)
[kilojoules-20160s:64471] Signal code:  (0)
[kilojoules-20160s:64471] *** End of error message ***
like image 459
kilojoules Avatar asked Feb 25 '16 23:02

kilojoules


1 Answers

This problem may occur if the .so file from homebrew's formula links against a different python library than the interpreter you are running, see also this thread and this response.

If you have no other dependencies then running your program using the python interpreter from homebrew (which should be located in /usr/local/bin/) may solve the issue.

like image 97
user8472 Avatar answered Oct 12 '22 18:10

user8472