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 <noreply@anthropic.com>
This commit is contained in:
James Smith
2026-03-18 20:44:52 +00:00
parent e1b532d48a
commit 0078d539de
2 changed files with 2 additions and 1 deletions

View File

@@ -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)

View File

@@ -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