From 876a6eb3ba9974d0eadc1fd3f628dafdc56d8716 Mon Sep 17 00:00:00 2001 From: historia Date: Fri, 28 Aug 2026 04:18:56 -0400 Subject: fix: system python used instead of venv python, breaking whisper transcription --- app/backends/envs.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'app/backends') diff --git a/app/backends/envs.py b/app/backends/envs.py index ff6d1bf..494c3e2 100644 --- a/app/backends/envs.py +++ b/app/backends/envs.py @@ -89,9 +89,16 @@ def env_exists(env_dir: Optional[Path] = None) -> bool: def is_managed_env() -> bool: - """True when the current process is already running inside the app venv.""" + """True when the current process is already running inside the app venv. + + Compares sys.prefix (the environment the current interpreter belongs to) + with ENV_DIR instead of the interpreter path: a venv's bin/python is + typically a symlink to the base interpreter, so resolving sys.executable + would also make the bare system python look like the managed env and + silently skip the bootstrap (and with it the requirements install). + """ try: - return Path(sys.executable).resolve() == env_python().resolve() + return Path(sys.prefix).resolve() == ENV_DIR.resolve() except OSError: return False -- cgit v1.2.3