1

I have a python application where I'm using tesserocr, ocrmypdf. I am trying to create a stand-alone executable of it by using PyInstaller.

I can successfully create the executable by using the following command

$ pyinstaller -F --clean code.py

But when I run it

$ ./code

I get this error

ModuleNotFoundError: No module named 'tesserocr'

ModuleNotFoundError: No module named 'ocrmypdf'

code.py

from tesserocr import PyTessBaseAPI
import ocrmypdf

...

I have cross checked tesserocr and ocrmypdf are successfully installed in my system.

Atinesh
  • 1,790
  • 9
  • 36
  • 57

1 Answers1

1

Try this

pyinstaller -F --clean code.py --hidden-import='tesserocr.PyTessBaseAPI' --hidden-import='ocrmypdf'
MohitGhodasara
  • 2,342
  • 1
  • 22
  • 29