0

I have a Python wrapper (to a C lib) generated by Swig.

Have unittest run happy within PyDev.

Project structure follow PyBuilder suggested setup:

   |-src
      |-main
          |-python
                |-A.py
                |-_A.so
      |-unittest
          |-python
                |-A_tests.py

when try run pyb, got following error:

Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6

NOTE: If I change A to a pure Python module, everything works.

Must be something (step) missing related to load that .so file.

Sorry for a newbie question like this. Any help will be greatly appreciated.

1 Answers1

0

is it possible you build the .so library for another python version? PyBuilder does not do anything special about shared objects, especially not when running unit tests.

So try running ldd _A.so and see if that matches the interpreter you're using with pyb?

user3633465
  • 106
  • 1
  • Yes! Thanks for the help. the problem seems the linked lib is python 2.7.2 while my running env is python 2.7.8. That is the issue. – user3629106 Jan 07 '15 at 19:45
  • The 2.7.8 is installed in virtualenv (using virtualenvwrapper), having trouble to let the compiler link to correctly lib (use right python). Seems always get back to system python (2.7.2). To get things moving, I end up install pybuilder in python 2.7.2 (where /user/bin/python) and the building process working. – user3629106 Jan 07 '15 at 19:57