Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ENH]: Provide a way to avoid subcommands on import. #28488

Open
@craigcitro-ant

Description

@craigcitro-ant

Problem

tl;dr: I'd like to be able to avoid from matplotlib import pyplot as plt invoking subprocesses at import time.

More generally: we often run jobs which involve a transitive import of matplotlib; for reasons I do not fully understand, we see rare but regular flakes where the process hangs during import, specifically at this line where matplotlib first invokes fc-list. The code is written to be robust to fc-list not existing, but here it's the existence check itself that's causing trouble.

I'd like to be able to disable that call; in general, I suspect "this library is running subcommands during package import" may well cause these sorts of problems in other environments, so I suspect this would be helpful to other users as well.

Proposed solution

I've got a quick first pass at the type of change I'm describing at craigcitro-ant@46d64f2; if that looks acceptable, I'm more than happy to clean it up and send a PR. (The main thing that's missing is adding a mention to the docs.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions