fixed: Added the Python executable path to the PATH environment variable, preventing potential issues caused by a missing PATH.

https://github.com/ltdrdata/ComfyUI-Manager/issues/1554
This commit is contained in:
Dr.Lt.Data
2025-02-25 12:18:31 +09:00
parent 4fd17b0bf5
commit 86893d999a
4 changed files with 15 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ import subprocess
import sys
import re
import logging
import platform
cache_lock = threading.Lock()
@@ -21,6 +22,16 @@ cache_dir = os.path.join(comfyui_manager_path, '.cache') # This path is also up
use_uv = False
def add_python_path_to_env():
if platform.system() != "Windows":
sep = ':'
else:
sep = ';'
os.environ['PATH'] = os.path.dirname(sys.executable)+sep+os.environ['PATH']
def make_pip_cmd(cmd):
if use_uv:
return [sys.executable, '-m', 'uv', 'pip'] + cmd