Closed ghost closed 10 months ago
This bug occurs in systems where the system language is not Simplified Chinese and will be fixed in the next release. In the meantime, you can manually update the code to fix the bug:
Open UmiOCR-data/main.py
with Notepad or any text editor.
Find these lines of code:
# 尝试获取控制台的输出对象
try:
fd = os.open("CONOUT$", os.O_RDWR | os.O_BINARY)
fp = os.fdopen(fd, "w")
except Exception as e:
fp = open(os.devnull, "w")
Add 【, encoding="utf-8"】 after the two "w"s, so it looks like this:
# 尝试获取控制台的输出对象
try:
fd = os.open("CONOUT$", os.O_RDWR | os.O_BINARY)
fp = os.fdopen(fd, "w", encoding="utf-8")
except Exception as e:
fp = open(os.devnull, "w", encoding="utf-8")
Save the file. You should now be able to start the Umi-OCR.exe
normally.
thanks!
title as it is, using 2.0.1 paddleocr edition on windows10 pro 22h2