Skip to content

tohil + numpy + subinterpreters = fail #89

@stevel6868

Description

@stevel6868

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions