[Scons-users] LoadableModule on Python OSX binding generates "PyThreadState_Get: no current thread"

Marc Magrans de Abril marcmagransdeabril at gmail.com
Thu Aug 16 12:49:50 EDT 2012


Hi,

You were right! The following SConstruct file worked:
env = Environment()

env.Append( CXXFLAGS=['-Wall'])
env.Append( CPPPATH=
['../mylib/include','/opt/local/include','/usr/include/python2.7'])

env.Append( LIBPATH = ['/opt/local/lib','../mylib/lib'])
env.Append( LIBS = ['python2.7','boost_python','mylib'])

env.LoadableModule('lib/mybindings.so', 'src/mybindings.cpp')

Many thanks,
marc


On Tue, Aug 14, 2012 at 6:26 AM, Luc Bourhis <luc_j_bourhis at mac.com> wrote:

> Hi Marc,

>

> my guess is that you have a conflict between Python from /opt/local (MacPorts I guess) and System Python.

>

>> env.Append( LIBPATH = ['/opt/local/lib','../mylib/lib'])

>> env.Append( LIBS = ['python','boost_python','mylib'])

>

> MacPorts installs /opt/local/lib/libpython2.x.dylib but no /opt/local/lib/libpython.dylib. So I think that you are actually linking against System Python whereas you ran MacPorts Python when you did

>

>> $ python mytest/mytest.py

>> Fatal Python error: PyThreadState_Get: no current thread

>

> To confirm, what does 'type python' prints out?

>

> Your core dump clearly shows the aforementioned admixture of /opt/local/... and /System/... Python.

>

> HtH,

>

> Luc J. Bourhis

>

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users



More information about the Scons-users mailing list