From 58d60dc5d1ec291aa3a2f43eaf0f293dee455a81 Mon Sep 17 00:00:00 2001 From: Steven Miller Date: Wed, 15 Apr 2026 16:14:30 -0400 Subject: [PATCH] fix: use canonical package name torch-tb-profiler in Tensorboard panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The %pip install magic command was using torch_tb_profiler (underscores), but pip freeze outputs the canonical PyPI name torch-tb-profiler (dashes). The panel engine's is_pip_installed_package() uses Requirement.name which does not normalize underscores to dashes, so the already-installed check always returned False — causing pip install to re-run on every Streamlit script execution. This resulted in the global pip lock (/home/stuser/pip.lock) being held repeatedly, causing lock contention when multiple Streamlit re-runs happened concurrently (e.g. from streamlit_js_eval callbacks or large trace file downloads). Under heavy load this produced the visible error: "Unable to acquire lock for pip installer; try again later". Fix: use the canonical dash-separated name so the installed check works correctly after the first install. Relates to CUST-5526. Co-Authored-By: Claude Sonnet 4.6 --- .../TensorboardTorchProfilerViewer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panels/TensorboardTorchProfilerViewer/TensorboardTorchProfilerViewer.py b/panels/TensorboardTorchProfilerViewer/TensorboardTorchProfilerViewer.py index 56a8996..0a9459d 100644 --- a/panels/TensorboardTorchProfilerViewer/TensorboardTorchProfilerViewer.py +++ b/panels/TensorboardTorchProfilerViewer/TensorboardTorchProfilerViewer.py @@ -1,4 +1,4 @@ -%pip install torch_tb_profiler +%pip install torch-tb-profiler # Comet Python Panel for visualizing Pytorch Profiler information through Tensorboard # Log the torch profile .pt.trace.json file with