feat: pip fixer for torch, opencv

fixed: Preventing the browser from reopening automatically after a restart on Windows.
This commit is contained in:
Dr.Lt.Data
2024-11-24 23:33:53 +09:00
parent 4a908d970a
commit 02f1788261
5 changed files with 165 additions and 27 deletions

View File

@@ -385,30 +385,7 @@ check_bypass_ssl()
# Perform install
processed_install = set()
script_list_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "startup-scripts", "install-scripts.txt")
pip_map = None
def get_installed_packages():
global pip_map
if pip_map is None:
try:
result = subprocess.check_output([sys.executable, '-m', 'pip', 'list'], universal_newlines=True)
pip_map = {}
for line in result.split('\n'):
x = line.strip()
if x:
y = line.split()
if y[0] == 'Package' or y[0].startswith('-'):
continue
pip_map[y[0]] = y[1]
except subprocess.CalledProcessError as e:
print(f"[ComfyUI-Manager] Failed to retrieve the information of installed pip packages.")
return set()
return pip_map
pip_fixer = PIPFixer(get_installed_packages())
def is_installed(name):
@@ -620,8 +597,11 @@ if os.path.exists(script_list_path):
print("\n[ComfyUI-Manager] Startup script completed.")
print("#######################################################################\n")
pip_fixer.fix_broken()
del processed_install
del pip_map
del pip_fixer
clear_pip_cache()
def check_windows_event_loop_policy():