问题遇到的现象和发生背景
我写了一个UI自动化,打包成 exe文件运行的时候 报错 提示找不到指定模块
问题相关代码,请勿粘贴截图
代码太多了
运行结果及报错内容
[E:onnxruntime:Default, provider_bridge_ort.cc:889 onnxruntime::ProviderSharedLibrary::Ensure] LoadLibrary failed with error 126 "找不到指定的模块。" when trying to load "C:\Users\ADMINI~1\AppData\Local\Temp_MEI146362\onnxruntime\capi\onnxruntime_providers_shared.dll"
2022-02-27 02:54:54.3028548 [W:onnxruntime:Default, onnxruntime_pybind_state.cc:1516 onnxruntime::python::CreateInferencePybindStateModule] Init provider bridge failed.
self = <test_lon.Testapi object at 0x000001B66066C5B0>
@pytest.mark.run(order=7)
def test_lon(self):
chrome_options = Options()
# chrome_options.add_argument('--headless') # 静默运行
chrome_options.add_argument('--disable-gpu') # 不加载浏览器谢谢
chrome_options.add_argument('log-level=3') # 不打印日志
# # 开启静默模式
# driver = webdriver.Chrome(chrome_options=chrome_options)
# driver.get("https://www.zhongdengwang.org.cn/")
#
driver = webdriver.Chrome()
driver.get("https://www.zhongdengwang.org.cn/")
driver.maximize_window()
randoms = str(random.randint(11111, 99999))
name1 = randoms
urli = driver.find_element(By.ID,"checkImg").screenshot('D:/jtyl/'+ name1 + '.png')
ocr = ddddocr.DdddOcr()
test_lon.py:181:
ddddocr_init_.py:1455: in init
???
onnxruntime\capi\onnxruntime_inference_collection.py:324: in init
???
self = <onnxruntime.capi.onnxruntime_inference_collection.InferenceSession object at 0x000001B66067B700>
providers = ['CPUExecutionProvider'], provider_options = [{}], disabled_optimizers = None
???
E onnxruntime.capi.onnxruntime_pybind11_state.NoSuchFile: [ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from C:\Users\ADMINI1\AppData\Local\Temp_MEI146362\ddddocr\common.onnx failed:Load model C:\Users\ADMINI1\AppData\Local\Temp_MEI146362\ddddocr\common.onnx failed. File doesn't exist
onnxruntime\capi\onnxruntime_inference_collection.py:358: NoSuchFile
========================================================== warnings summary ===========================================================
test_lon.py:20
D:\jtyl\test_lon.py:20: DeprecationWarning: invalid escape sequence \j
a = os.path.isfile("D:\jtyl\password.yaml")
test_lon.py:32
D:\jtyl\test_lon.py:32: DeprecationWarning: invalid escape sequence \j
with open("D:\jtyl\password.yaml", encoding='utf-8', mode='w') as f:
test_lon.py:37
D:\jtyl\test_lon.py:37: DeprecationWarning: invalid escape sequence \j
with open("D:\jtyl\password.yaml", encoding='utf-8') as f:
test_lon.py:40
D:\jtyl\test_lon.py:40: DeprecationWarning: invalid escape sequence \j
with open("D:\jtyl\password.yaml", encoding='utf-8') as f:
test_lon.py:157
D:\jtyl\test_lon.py:157: DeprecationWarning: invalid escape sequence \j
with open("D:\jtyl\yaml.yaml", encoding='utf-8', mode='w') as f:
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================================= short test summary info =======================================================
FAILED test_lon.py::Testapi::test_lon - onnxruntime.capi.onnxruntime_pybind11_state.NoSuchFile: [ONNXRuntimeError] : 3 : NO_SUCHFILE ...
=============================================== 1 failed, 6 passed, 5 warnings in 4.98s ===============================================
[1248:12932:0227/025500.614:ERROR:chrome_browser_main_extra_parts_metrics.cc(227)] START: ReportBluetoothAvailability(). If you don't see the END: message, this is crbug.com/1216328.
[1248:12932:0227/025500.615:ERROR:chrome_browser_main_extra_parts_metrics.cc(230)] END: ReportBluetoothAvailability()
[1248:12932:0227/025500.616:ERROR:chrome_browser_main_extra_parts_metrics.cc(235)] START: GetDefaultBrowser(). If you don't see the END: message, this is crbug.com/1216328.
[1248:15264:0227/025500.643:ERROR:device_event_log_impl.cc(214)] [02:55:00.643] Bluetooth: bluetooth_adapter_winrt.cc:1075 Getting Default Adapter failed.
[1248:12932:0227/025500.646:ERROR:chrome_browser_main_extra_parts_metrics.cc(239)] END: GetDefaultBrowser()
D:\jtyl>[16332:16336:0227/025523.017:ERROR:gpu_init.cc(454)] Passthrough is not supported, GL is disabled, ANGLE is