Restored from slopsmith/slopsmith-desktop#279 — original pull request (open PR; branch did not survive redaction, archived as issue), opened by @byrongamatos on 2026-06-03.
[restored-from: slopsmith/slopsmith-desktop#279]
Problem
Windows portable builds crash on clean tester machines with ModuleNotFoundError: No module named 'typing_extensions' ("Backend failed: python process failed before startup completed") — yet work on the build machine. First-launch also hangs while the server runs blocking pip install for heavy optional plugins.
Cause
The embeddable Python's import site enables the per-user site (%APPDATA%\Python\...). On a build machine with a system Python, pip sees transitive deps as already satisfied via user-site and skips bundling them (typing_extensions, urllib3, certifi, idna, charset_normalizer, psutil, requests). The dev box masks it at runtime too; clean machines have no user-site → import crash. Separately, the server pip installs plugin requirements at startup, which blocks on multi-GB deps.
Fix
build-common.sh: export PYTHONNOUSERSITE=1 so the build's pip resolves against the bundle only and installs every transitive dep. No-op on clean CI (no user-site).
python.ts: set PYTHONNOUSERSITE=1 in the server env (never read an end user's user-site); and when packaged, set SLOPSMITH_SKIP_PLUGIN_INSTALL=1 so startup isn't blocked by runtime plugin installs (pairs with the slopsmith-core change that honours the flag; plugins load degraded until deps exist).
Safety
Build-script + spawn-env only; no app-logic change. Fixes a real shipped-build crash. Recommended before the 0.2.9 desktop release. Verified: with PYTHONNOUSERSITE=1, the Windows bundle imports the full server cleanly under a clean-machine simulation.
🤖 Generated with Claude Code
Summary by CodeRabbit
- Bug Fixes
- Resolved dependency bundling issues that could cause missing modules on clean machines by isolating bundled dependencies from per-user packages.
- Improved startup behavior for packaged builds to prevent blocking on optional plugin installations.
Problem
Windows portable builds crash on clean tester machines with
ModuleNotFoundError: No module named 'typing_extensions'("Backend failed: python process failed before startup completed") — yet work on the build machine. First-launch also hangs while the server runs blockingpip installfor heavy optional plugins.Cause
The embeddable Python's
import siteenables the per-user site (%APPDATA%\Python\...). On a build machine with a system Python, pip sees transitive deps as already satisfied via user-site and skips bundling them (typing_extensions,urllib3,certifi,idna,charset_normalizer,psutil,requests). The dev box masks it at runtime too; clean machines have no user-site → import crash. Separately, the serverpip installs plugin requirements at startup, which blocks on multi-GB deps.Fix
build-common.sh:export PYTHONNOUSERSITE=1so the build's pip resolves against the bundle only and installs every transitive dep. No-op on clean CI (no user-site).python.ts: setPYTHONNOUSERSITE=1in the server env (never read an end user's user-site); and when packaged, setSLOPSMITH_SKIP_PLUGIN_INSTALL=1so startup isn't blocked by runtime plugin installs (pairs with the slopsmith-core change that honours the flag; plugins load degraded until deps exist).Safety
Build-script + spawn-env only; no app-logic change. Fixes a real shipped-build crash. Recommended before the 0.2.9 desktop release. Verified: with
PYTHONNOUSERSITE=1, the Windows bundle imports the full server cleanly under a clean-machine simulation.🤖 Generated with Claude Code
Summary by CodeRabbit