currently the core.py file runs the inference scripts using the hardcoded python command.
this is problematic when running inside a venv because the subprocess.run() starts a new process without inheriting the python executable that was used to run the parent process, and results in dependency errors (since it tries to look for dependencies in the globally installed python environment instead of the current venv when running inside a venv).
by using sys.executable, we can solve this. it will automatically use the globally installed python when running normally, and it will use the python in the current venv when running in a venv.
currently the core.py file runs the inference scripts using the hardcoded
python
command.this is problematic when running inside a venv because the
subprocess.run()
starts a new process without inheriting the python executable that was used to run the parent process, and results in dependency errors (since it tries to look for dependencies in the globally installed python environment instead of the current venv when running inside a venv).by using
sys.executable
, we can solve this. it will automatically use the globally installed python when running normally, and it will use the python in the current venv when running in a venv.