2

I am testing TensorBox, which is based on Google's Tensorflow for some task. There is a small piece of code that needs to be compiled and I compile it. When running otool -L stitch_wrapper.so this is the output:

stitch_wrapper.so (compatibility version 0.0.0, current version 0.0.0)
libpython2.7.dylib (compatibility version 2.7.0, current version 2.7.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1225.1.1)

Whenever I do in python import stitch_wrapper, I get the error:

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

I read in a comment in this other question that this happens whenever a module tries to use a python library that is different than the one the interpreter uses, that is, when you mix two different pythons. I have two different pythons in the machine, and the one I am using when running the code is the anaconda python that I installed in my home directory. Pardon my question if I am confused, but how can I compile properly for my anaconda python? I tried importing within my other python and it works well. But I need it working for my anaconda python.

Community
  • 1
  • 1
Jadiel de Armas
  • 8,405
  • 7
  • 46
  • 62

1 Answers1

0

As you say, this happens because you have compiled the extension for a different Python version.

To make it work within Anaconda, you must see if they provide Python libraries, header files and so on. Then you must recompile everything using the right flags. If Anaconda provides python-config, you can get the flags from there.

csl
  • 10,937
  • 5
  • 57
  • 89