Title: [ENH]: Provide a way to avoid subcommands on import. · Issue #28488 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH]: Provide a way to avoid subcommands on import. · Issue #28488 · matplotlib/matplotlib
X Title: [ENH]: Provide a way to avoid subcommands on import. · Issue #28488 · matplotlib/matplotlib
Description: 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 understa...
Open Graph Description: 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 matplot...
X Description: 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 mat...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/28488
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH]: Provide a way to avoid subcommands on import.","articleBody":"### Problem\n\ntl;dr: I'd like to be able to avoid `from matplotlib import pyplot as plt` invoking subprocesses at import time.\r\n\r\nMore 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](https://github.com/matplotlib/matplotlib/blob/74c7f9a598c4e32b3f551f75ed965f446d786ab1/lib/matplotlib/font_manager.py#L256) 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.\r\n\r\nI'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.\n\n### Proposed solution\n\nI've got a quick first pass at the type of change I'm describing at https://github.com/craigcitro-ant/matplotlib/commit/46d64f26977c5a37074ece74d602051da2df09e7; 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.)","author":{"url":"https://github.com/craigcitro-ant","@type":"Person","name":"craigcitro-ant"},"datePublished":"2024-06-28T18:30:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/28488/matplotlib/issues/28488"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4dad50bb-0c5a-3ec0-b5ff-5c996463e191 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D6F8:234BE7:457D50:5DB0B7:6A527801 |
| html-safe-nonce | 18e51c14f18f2dde66737fa48421955032937a825424376225a975badb672c2e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENkY4OjIzNEJFNzo0NTdENTA6NURCMEI3OjZBNTI3ODAxIiwidmlzaXRvcl9pZCI6IjI0MDU4NjgzMDY3ODU1MzE5MDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a90b31c415d8c7b3fb337f0ec5305a8480f2377c6b40d5eaf7eeb72b1e8b4b2d |
| hovercard-subject-tag | issue:2380960766 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/28488/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cb193949f16ae431bd1fa37248b7285912047746601e68ff5f3345c8c7c133b2/matplotlib/matplotlib/issues/28488 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cb193949f16ae431bd1fa37248b7285912047746601e68ff5f3345c8c7c133b2/matplotlib/matplotlib/issues/28488 |
| og:image:alt | 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 matplot... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | craigcitro-ant |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width