Homebrew + Python on MAC Os X 10.8: Fatal Python Error: Pythreadstate_Get: No Current Thread Importing Mapnik

Issue with two versions of python

The google search possibly found Homebrew + Python on mac os x 10.8: Fatal Python error: PyThreadState_Get: no current thread importing mapnik however I was unable to find the library that links to a wrong version of python using otool.

I also found https://github.com/enthought/mayavi/issues/552 which suggests pinning to a different version of python.

Based on the install notes for hippy, https://hippylib.readthedocs.io/en/latest/installation.html then where they say conda create -n fenicproject ... you need to substitute the following:

conda create -n fenicsproject python==3.5.1
conda install -n fenicsproject -c conda-forge fenics==2017.2.0 \
mpi4py matplotlib scipy sympy==1.1.1 jupyter

After this, python -c 'import dolfin' no longer fails. It might also be possible to use a later version of python (I only tried 3.5.1).

Fatal error in extension: PyThreadState_Get: no current thread

I was able to solve this problem by changing the CMakeLists.txt to use -undefined dynamic_lookup as suggested in this answer. E.g. of the CMakeLists.txt is here. And the reason I was getting different outcomes on different machines was because one of my macs had Python 3.6.1 but the others had Python>=3.6.2

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

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.



Related Topics



Leave a reply



Submit