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

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条回答 默认 最新

  • 星浩前进中 2022-02-27 09:32
    关注

    可以看看我的博客,有介绍关于pyinstaller的一些常见问题
    http://t.csdn.cn/TK9Py

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

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

悬赏问题

  • ¥50 adb连接不到手机是怎么回事?
  • ¥15 vs2022无法联网
  • ¥15 TCP的客户端和服务器的互联
  • ¥15 VB.NET操作免驱摄像头
  • ¥15 笔记本上移动热点开关状态查询
  • ¥85 类鸟群Boids——仿真鸟群避障的相关问题
  • ¥15 CFEDEM自带算例错误,如何解决?
  • ¥15 有没有会使用flac3d软件的家人
  • ¥20 360摄像头无法解绑使用,请教解绑当前账号绑定问题,
  • ¥15 docker实践项目