Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cant run umi ocr without running it on cmd #306

Closed
ghost opened this issue Jan 8, 2024 · 2 comments
Closed

I cant run umi ocr without running it on cmd #306

ghost opened this issue Jan 8, 2024 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 8, 2024

title as it is, using 2.0.1 paddleocr edition on windows10 pro 22h2

@hiroi-sora
Copy link
Owner

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:

  1. Open UmiOCR-data/main.py with Notepad or any text editor.

  2. 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")
  1. 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")
  1. Save the file. You should now be able to start the Umi-OCR.exe normally.

@ghost
Copy link
Author

ghost commented Jan 10, 2024

thanks!

@ghost ghost closed this as completed Jan 10, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant