13 lines
410 B
Python
13 lines
410 B
Python
import sys
|
|
import subprocess
|
|
|
|
|
|
def ensure_onnx_package():
|
|
try:
|
|
import onnxruntime
|
|
except Exception:
|
|
if "python_embeded" in sys.executable or "python_embedded" in sys.executable:
|
|
subprocess.check_call([sys.executable, '-s', '-m', 'pip', 'install', 'onnxruntime'])
|
|
else:
|
|
subprocess.check_call([sys.executable, '-s', '-m', 'pip', 'install', 'onnxruntime'])
|