Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
246 views
in Technique[技术] by (71.8m points)

c++ - 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 ***
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...