tohil
tohil copied to clipboard
tohil + numpy + subinterpreters = fail
Not a tohil problem per se, but wondering if anyone has encountered this and resolved it.
I have a multithreaded Tcl program that does a bunch of calculations in each thread by tohil::call into a Python script that uses numpy. Results are fed back to Tcl via tohil.call to a Tcl proc. Works just fine with a single thread, but with multiple threads the second thread gets an error "Interpreter change detected - this module can only be loaded into one interpreter per process. (import module failed)" when running "import numpy".
It seems numpy explicitly doesn't like Python subintepreters. Does anyone have a workaround?