title: Tesseract OCR doesn't work when Python script is converted to exe without console
body: <p>I have an ML solution. I use Pytesseract in this solution. I need to create an executable from it. So I use the pyinstaller. To create an executable that can call another exe, the tesseract exe, I followed the <a href="https://stackoverflow.com/a/60679256/13080899">https://stackoverflow.com/a/60679256/13080899</a>. When I create the exe with console Tesseract exe is called in my exe and gives me output but if I create the exe without console Tesseract doesn't work. I couldn't find any solution. How can I solve the problem?</p>
  <p>Here is the my .spec file:</p>
  <pre><code># -*- mode: python ; coding: utf-8 -*-
  import sys
  sys.setrecursionlimit(5000)
  
  block_cipher = None
  
  
  a = Analysis(['Cam_Choice.py'],
               pathex=['D:\\Project\\XXX'],
               binaries=[('config\\tesseract\\tesseract.exe', 'config\\tesseract')],
               datas=[],
               hiddenimports=['boto3'],
               hookspath=[],
               runtime_hooks=[],
               excludes=[],
               win_no_prefer_redirects=False,
               win_private_assemblies=False,
               cipher=block_cipher,
               noarchive=False)
  a.datas += [('logo.ico', 'D:\\Project\\img\\logo.ico', &quot;DATA&quot;)]
  
  pyz = PYZ(a.pure, a.zipped_data,
               cipher=block_cipher)
  exe = EXE(pyz,
            a.scripts,
            a.binaries,
            a.zipfiles,
            a.datas,
            [],
            name='XXX',
            debug=False,
            bootloader_ignore_signals=False,
            strip=False,
            upx=True,
            upx_exclude=[],
            runtime_tmpdir=None,
            console=False,
        icon='D:\\Project\\img\\logo.ico')
  </code></pre>
  <p>P.S: Because of non-console mode I can't debug the exe.</p>