1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 13:17:00 +08:00

Fix: OSError when loading MAA (#2010)

This commit is contained in:
SarContDeli
2022-12-18 13:34:45 +08:00
committed by GitHub
parent a2e6c401da
commit b12eabc44a
2 changed files with 6 additions and 3 deletions

View File

@@ -35,6 +35,10 @@ class Asst:
if platform.system().lower() == 'windows':
Asst.__libpath = pathlib.Path(path) / 'MaaCore.dll'
os.environ["PATH"] += os.pathsep + str(path)
try:
ctypes.WinDLL(str(pathlib.Path(path) / 'onnxruntime.dll'))
except Exception:
pass
Asst.__lib = ctypes.WinDLL(str(Asst.__libpath))
elif platform.system().lower() == 'darwin':
Asst.__libpath = pathlib.Path(path) / 'libMaaCore.dylib'