hiroi-sora / Umi-OCR

OCR software, free and offline. 开源、免费的离线OCR软件。支持截屏/批量导入图片,PDF文档识别,排除水印/页眉页脚,扫描/生成二维码。内置多国语言库。
MIT License
27.59k stars 2.77k forks source link

EXE双击无显示,运行GUI提示找不到文件 #221

Closed pingal-alealeale closed 1 year ago

pingal-alealeale commented 1 year ago
error
hiroi-sora commented 1 year ago

看起来工作路径不对劲,启动脚本的工作路径是C:\Windows\System32而不是Umi-OCR目录下,所以按照相对路径当然找不到文件。

你是双击启动bat的还是在命令行里启动的?

另外,试下在命令行里启动exe,看看有何输出?(即在Umi-OCR目录下,shift+右键→在此处打开Powershell→输入./Umi-OCR.exe→回车)

pingal-alealeale commented 1 year ago

在下载文件夹解压缩后在powershell运行是这样: PS C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025> .\Umi-OCR.exe PS C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025> Traceback (most recent call last): File "C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025\UmiOCR-data\site-packages\pyzbar\zbar_library.py", line 58, in load dependencies, libzbar = load_objects(Path('')) File "C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025\UmiOCR-data\site-packages\pyzbar\zbar_library.py", line 50, in load_objects deps = [ File "C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025\UmiOCR-data\site-packages\pyzbar\zbar_library.py", line 51, in cdll.LoadLibrary(str(directory.joinpath(dep))) File "ctypes__init.py", line 451, in LoadLibrary File "ctypes\init.py", line 373, in init__ FileNotFoundError: Could not find module 'libiconv.dll' (or one of its dependencies). Try using the full path with constructor syntax.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025\UmiOCR-data\main.py", line 60, in runScript() # 启动脚本 File "C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025\UmiOCR-data\main.py", line 55, in runScript main() File "C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025\UmiOCR-data\py_src\run.py", line 109, in main res = runQml() # 启动qml File "C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025\UmiOCR-data\py_src\run.py", line 25, in runQml from .tag_pages.tag_pages_connector import TagPageConnector # 页面连接器 File "C:\Users\S\AppData\Local\Temp\embedded.6usagh_w.zip\shibokensupport__feature.py", line 142, in _import File "C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025\UmiOCR-data\py_src\tag_pages\tag_pages_connector.py", line 15, in from .QRcode import QRcode File "C:\Users\S\AppData\Local\Temp\embedded.6usagh_w.zip\shibokensupport__feature.py", line 142, in _import File "C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025\UmiOCR-data\py_src\tag_pages\QRcode.py", line 12, in import pyzbar.pyzbar as pyzbar File "C:\Users\S\AppData\Local\Temp\embedded.6usagh_w.zip\shibokensupport__feature__.py", line 142, in _import File "C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025\UmiOCR-data\site-packages\pyzbar\pyzbar.py", line 7, in from .wrapper import ( File "C:\Users\S\AppData\Local\Temp\embedded.6usagh_w.zip\shibokensupport\feature__.py", line 142, in _import File "C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025\UmiOCR-data\site-packages\pyzbar\wrapper.py", line 151, in zbar_version = zbar_function( File "C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025\UmiOCR-data\site-packages\pyzbar\wrapper.py", line 148, in zbar_function return prototype((fname, load_libzbar())) File "C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025\UmiOCR-data\site-packages\pyzbar\wrapper.py", line 127, in load_libzbar libzbar, dependencies = zbar_library.load() File "C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025\UmiOCR-data\site-packages\pyzbar\zbar_library.py", line 60, in load dependencies, libzbar = load_objects(Path(file__).parent) File "C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025\UmiOCR-data\site-packages\pyzbar\zbar_library.py", line 54, in load_objects libzbar = cdll.LoadLibrary(str(directory.joinpath(fname))) File "ctypes__init.py", line 451, in LoadLibrary File "ctypes\init.py", line 373, in init__ FileNotFoundError: Could not find module 'C:\Users\S\Downloads\Umi-OCR_Paddle_dev_20231025\UmiOCR-data\site-packages\pyzbar\libzbar-64.dll' (or one of its dependencies). Try using the full path with constructor syntax.

将Umi-OCR.exe和UmiOCR-data拷贝到system32文件夹下,运行powershell是这样: PS C:\Windows\System32\UmiOCR-data> .\RUN_GUI.bat

C:\Windows\System32\UmiOCR-data>start "" runtime/pythonw.exe main.py PS C:\Windows\System32\UmiOCR-data>


发件人: hiroi-sora @.> 发送时间: 2023年11月4日 15:18 收件人: hiroi-sora/Umi-OCR @.> 抄送: pingal-alealeale @.>; Author @.> 主题: Re: [hiroi-sora/Umi-OCR] EXE双击无显示,运行GUI提示找不到文件 (Issue #221)

看起来工作路径不对劲,启动脚本的工作路径是C:\Windows\System32而不是Umi-OCR目录下,所以相对路径找不到文件。

你是双击启动bat的还是在命令行里启动的?

另外,试下在命令行里启动exe,看看有何输出?(即在Umi-OCR目录下,shift+右键→在此处打开Powershell→输入./Umi-OCR.exe→回车)

― Reply to this email directly, view it on GitHubhttps://github.com/hiroi-sora/Umi-OCR/issues/221#issuecomment-1793368520, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BDXFKGILM24IJIDE3CNPUN3YCXT5TAVCNFSM6AAAAAA647V6YCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTGM3DQNJSGA. You are receiving this because you authored the thread.Message ID: @.***>

hiroi-sora commented 1 year ago

哦哦,此bug已在新的预览版里修复。麻烦下载个新版试试。 https://github.com/hiroi-sora/Umi-OCR_v2/releases