From 16391a660d074b89d62554e06160a05927830108 Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 18 Mar 2026 20:44:52 +0000 Subject: [PATCH] Fix flask-sock ImportError caused by simple-websocket missing from venv When pip installs flask-sock into the venv, it finds simple-websocket already satisfied in ~/.local (user site-packages from a prior install) and skips installing it into the venv. The venv Python cannot import from ~/.local (user site-packages are disabled in venvs), so flask_sock's top-level "from simple_websocket import Server" raises ImportError, and all WebSocket features are silently disabled. Fix: explicitly list simple-websocket>=0.5.1 as an install target in setup.sh and requirements.txt so pip installs it into the venv regardless of what is already present in user or system site-packages. Co-Authored-By: Claude Sonnet 4.6 --- requirements.txt | 1 + setup.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 103c73c..2567927 100644 --- a/requirements.txt +++ b/requirements.txt @@ -45,6 +45,7 @@ cryptography>=41.0.0 # mypy>=1.0.0 # WebSocket support for in-app audio streaming (KiwiSDR, Listening Post) flask-sock +simple-websocket>=0.5.1 websocket-client>=1.6.0 # System health monitoring (optional - graceful fallback if unavailable) diff --git a/setup.sh b/setup.sh index 906b3d7..bd3b880 100755 --- a/setup.sh +++ b/setup.sh @@ -558,7 +558,7 @@ install_python_deps() { ok "Core Python packages installed" info "Installing optional packages..." - for pkg in "flask-sock" "websocket-client>=1.6.0" "numpy>=1.24.0" "scipy>=1.10.0" \ + for pkg in "flask-sock" "simple-websocket>=0.5.1" "websocket-client>=1.6.0" "numpy>=1.24.0" "scipy>=1.10.0" \ "Pillow>=9.0.0" "skyfield>=1.45" "bleak>=0.21.0" "psycopg2-binary>=2.9.9" \ "meshtastic>=2.0.0" "scapy>=2.4.5" "qrcode[pil]>=7.4" "cryptography>=41.0.0" \ "gunicorn>=21.2.0" "gevent>=23.9.0" "psutil>=5.9.0"; do