uninstall every onnxruntime first

This commit is contained in:
henryruhs
2026-08-04 13:05:12 +02:00
parent 1db0cb8a46
commit 454ed90197
+3 -4
View File
@@ -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)