pythonpytorcheasyocr

FileNotFoundError in module easyocr when running exe file


I am trying to run exe file and scan picture with easyocr, but here's occurs the error. Could someone help me, please?

Traceback (most recent call last):
  File "threading.py", line 954, in _bootstrap_inner
  File "threading.py", line 892, in run
  File "ZhongDon.py", line 26, in ocr_simp
  File "easyocr\easyocr.py", line 200, in __init__
  File "easyocr\easyocr.py", line 261, in setLanguageList
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Idensas\\AppData\\Local\\Temp\\_MEI44842\\easyocr\\character\\ch_sim_char.txt'

There are also warnings, but I ignored them

[4484] WARNING: file already exists but should not: C:\Users\Idensas\AppData\Local\Temp\_MEI44842\torch\_C.cp39-win_amd64.pyd
torch\_jit_internal.py:750: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x0000015A402A1D30>.
  warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.")
torch\_jit_internal.py:750: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x0000015A402D8040>.
  warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.")

enter image description here


Solution

  • This has solved my problem

    pyinstaller -F ZhongDon.py --collect-all easyocr
    

    Found the solution here