diff --git a/facefusion/installer.py b/facefusion/installer.py index 037d94a1..bf6acf4b 100644 --- a/facefusion/installer.py +++ b/facefusion/installer.py @@ -55,6 +55,9 @@ def run(program : ArgumentParser) -> None: sys.stdout.write(LOCALES.get('conda_not_activated') + os.linesep) sys.exit(1) + for onnxruntime_package, _ in ONNXRUNTIME_SET.values(): + subprocess.call([ shutil.which('pip'), 'uninstall', onnxruntime_package, '-y', '-q' ], stderr = subprocess.DEVNULL) + commands = [ shutil.which('pip'), 'install' ] if args.force_reinstall: @@ -70,8 +73,4 @@ def run(program : ArgumentParser) -> None: onnxruntime_name, onnxruntime_version = ONNXRUNTIME_SET.get(args.onnxruntime) commands.append(onnxruntime_name + '==' + onnxruntime_version) - - for onnxruntime_package, _ in ONNXRUNTIME_SET.values(): - subprocess.call([ shutil.which('pip'), 'uninstall', onnxruntime_package, '-y', '-q' ]) - subprocess.call(commands)