[Python-Dev] Sub-interpreters: importing numpy causes hang
njs at pobox.com
Tue Jan 22 22:51:24 EST 2019
On Tue, Jan 22, 2019 at 6:33 PM Stephan Reiter <stephan.reiter at gmail.com> wrote:
> Thanks for the answers so far. I appreciate them!
> Nathaniel, I'd like to allow Python plugins in my application. A
> plugin should be allowed to bring its own modules along (i.e.
> plugin-specific subdir is in sys.path when the plugin is active) and
> hence some isolation of them will be needed, so that they can use
> different versions of a given module. That's my main motivation for
> using subinterpreters.
> I thought about running plugins out-of-processes - a separate process
> for every plugin - and allow them to communicate with my application
> via RPC. But that makes it more complex to implement the API my
> application will offer and will slow down things due to the need to
> copy data.
> Maybe you have another idea for me? :)
Not really, sorry! I believe that most applications that support
Python plugins (like blender, gimp, libreoffice, etc.), do it by using
a single shared environment for all plugins. This is also how every
application written in Python works, so at the ecosystem level there's
a lot of pressure on module authors to make it possible to assemble
them into a single coherent environment.
Nathaniel J. Smith -- https://vorpus.org
More information about the Python-Dev