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,579
  • 8
  • 30
  • 52

1 Answers1

1

Try this

pyinstaller -F --clean code.py --hidden-import='tesserocr.PyTessBaseAPI' --hidden-import='ocrmypdf'
MohitGhodasara
  • 1,757
  • 21
  • 27