From cecd54856cfbb2585f75cf4834ed7eec33253a99 Mon Sep 17 00:00:00 2001 From: Ori Hoch Date: Thu, 30 Jun 2022 14:55:44 +0300 Subject: [PATCH] api proxy: use the current python interpreter to start uvicorn --- stride/api_proxy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stride/api_proxy.py b/stride/api_proxy.py index 9e2efee..18c329a 100644 --- a/stride/api_proxy.py +++ b/stride/api_proxy.py @@ -1,3 +1,4 @@ +import sys import time import subprocess from contextlib import contextmanager @@ -20,7 +21,7 @@ def start(enable=True): """ if enable: STRIDE_API_BASE_URL = config.STRIDE_API_BASE_URL - process = subprocess.Popen(['uvicorn', 'open_bus_stride_api.main:app', '--port', '0']) + process = subprocess.Popen([sys.executable, '-m', 'uvicorn', 'open_bus_stride_api.main:app', '--port', '0']) port = None try: for i in range(1, START_WAIT_TIME_ITERATIONS + 1):