fix: remove PYTHONPATH from subprocess env to prevent protobuf/mediapipe conflict

This commit is contained in:
Renato
2026-07-02 18:18:40 +02:00
parent 40e2b27074
commit 1425afe244
+4
View File
@@ -237,7 +237,11 @@ async def process_video(bot, url: str):
env = os.environ.copy() env = os.environ.copy()
env["NEXTCLOUD_TARGET"] = target env["NEXTCLOUD_TARGET"] = target
env["PYTHONUNBUFFERED"] = "1" env["PYTHONUNBUFFERED"] = "1"
# CRITICAL: Remove PYTHONPATH so the system protobuf doesn't conflict with
# the venv's protobuf used by mediapipe → fixes 'SymbolDatabase.GetPrototype' crash
env.pop("PYTHONPATH", None)
log.info(f"[process] Temp output dir: {temp_output}") log.info(f"[process] Temp output dir: {temp_output}")
log.info(f"[process] PYTHONPATH cleared from subprocess env (mediapipe safety)")
# 4. Build command — main.py MUST run with the viral venv Python # 4. Build command — main.py MUST run with the viral venv Python
cmd = [ cmd = [