This commit is contained in:
toto
2023-12-16 22:13:48 +08:00
parent 2abacd7fde
commit 6d6eb679d5
2 changed files with 14 additions and 8 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ import os, sys
main_path = os.path.dirname(__file__)
sys.path.append(main_path)
import install
import portrait.install
import requests
from tqdm import tqdm
from portrait.nodes import *
+13 -7
View File
@@ -1,6 +1,4 @@
import platform
import os
import shutil
import sys
import subprocess
import threading
@@ -13,6 +11,9 @@ sys.path.append(main_path)
windows_not_install = ['mmcv_full\n']
def log(msg):
print('toto==============', msg)
def handle_stream(stream, is_stdout):
stream.reconfigure(encoding=locale.getpreferredencoding(), errors='replace')
@@ -67,15 +68,20 @@ def is_installed(name):
return result
def check_and_install_requirements(file_path):
print(f"req_path: {file_path}")
log(file_path)
if os.path.exists(file_path):
with open(file_path, 'r') as file:
lines = file.readlines()
for line in lines:
if platform.system() == "Windows" and line in windows_not_install:
continue
else:
process_wrap(pip_install + [line], cwd=main_path)
log(line)
if not is_installed(line):
if platform.system() == "Windows" and line in windows_not_install:
log(f"windows skip {line}")
continue
else:
log(f"install {line}")
continue
process_wrap(pip_install + [line], cwd=main_path)
return False
return True