Atinesh
Atinesh

Reputation: 1920

Trouble using PyInstaller in Ubuntu

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.

Upvotes: 1

Views: 310

Answers (1)

MohitGhodasara
MohitGhodasara

Reputation: 2742

Try this

pyinstaller -F --clean code.py --hidden-import='tesserocr.PyTessBaseAPI' --hidden-import='ocrmypdf'

Upvotes: 1

Related Questions