浅_郁 2022-02-27 03:05 采纳率: 85.7%
浏览 472
已结题

pyinstaller 打包成exe文件后 运行报错找不到指定模块 怎么解决

问题遇到的现象和发生背景

我写了一个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

  • 写回答

1条回答 默认 最新

    报告相同问题?

    相关推荐 更多相似问题

    问题事件

    • 系统已结题 3月25日
    • 已采纳回答 3月17日
    • 创建了问题 2月27日

    悬赏问题

    • ¥15 用循环结构解决,刚学C语言
    • ¥16 请问pyglet如何做出不同按扭跳转不同页面的效果,以及如何储存选择选项的次数(语言-python)
    • ¥15 python怎么自动填表、登录?
    • ¥15 python列表嵌套按条件合并
    • ¥15 VBA怎么把工作簿A中的第N列,复制到工作簿B中的第N列。
    • ¥20 除了狗屎npm, 推荐一些编写web应用的方式?
    • ¥30 如何对嵌套结构体进行动态内存分配
    • ¥15 关于sprintf的几个问题
    • ¥15 不确定行列数的迷宫文件传入
    • ¥15 怎么解决kali linux从root文件夹里复制文件权限不够的问题