From 837c615789b86246cfe0a92efd29fda32762119f Mon Sep 17 00:00:00 2001 From: Sachin Shrestha Date: Fri, 14 Mar 2025 19:48:46 +0530 Subject: [PATCH] Fix macOS NSWindow error by using matplotlib 'Agg' backend --- detail_daemon_node.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/detail_daemon_node.py b/detail_daemon_node.py index 551261c..07c7cdd 100644 --- a/detail_daemon_node.py +++ b/detail_daemon_node.py @@ -4,6 +4,13 @@ from __future__ import annotations import io +# Trying matplotlib NSWindow warning workaround on macOS +import platform + +if platform.system() == 'Darwin': # Check if running on macOS + import matplotlib + matplotlib.use('Agg') # Set non-GUI backend to avoid crashes + import matplotlib.pyplot as plt import numpy as np import torch