From 8f31b6d74af2e144d471f8080bd3b229687e4bb0 Mon Sep 17 00:00:00 2001 From: D <157692623+dh4340@users.noreply.github.com> Date: Tue, 29 Apr 2025 09:14:23 +0100 Subject: [PATCH] Fix: Use dynamic Python command to run uvicorn and support pyenv setups. Updated the uvicorn startup command to dynamically detect and use either 'python3' or 'python', ensuring compatibility across different environments and pyenv setups. This avoids issues where only one of the commands is available. --- backend/start.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/start.sh b/backend/start.sh index 4588e4c34..84d5ec895 100755 --- a/backend/start.sh +++ b/backend/start.sh @@ -65,4 +65,6 @@ if [ -n "$SPACE_ID" ]; then export WEBUI_URL=${SPACE_HOST} fi -WEBUI_SECRET_KEY="$WEBUI_SECRET_KEY" exec uvicorn open_webui.main:app --host "$HOST" --port "$PORT" --forwarded-allow-ips '*' --workers "${UVICORN_WORKERS:-1}" +PYTHON_CMD=$(command -v python3 || command -v python) + +WEBUI_SECRET_KEY="$WEBUI_SECRET_KEY" exec "$PYTHON_CMD" -m uvicorn open_webui.main:app --host "$HOST" --port "$PORT" --forwarded-allow-ips '*' --workers "${UVICORN_WORKERS:-1}"