3

I want to convert my python script which contains a pdf to image converter to a .app file on MacOS, and be able to run this on a different machine. I have tried both pyinstaller and py2app and get the following error message:

Traceback (most recent call last):
  File "test.py", line 9, in <module>
ModuleNotFoundError: No module named 'fitz'
[96973] Failed to execute script 'test' due to unhandled exception!

For pyinstaller, I have tried --hiddenimports, and for py2app, I have tried editing the options dictionary in the setup.py file, as well as placing the "fitz" folder from my IDE's "site-packages" into the "python 3.9" folder in the generated app.

I am just trying to create a pdf to image app which requires no non-python dependencies like "poppler" or "Home-brew" or "ImageMajick".

I am not too sure how these py to exe/app converters work but what I presume is that the app searches for an import named "fitz" but in reality the pip installation is "PyMuPDF". Not too sure what I can do about that.

Bryan_Koh
  • 31
  • 1

0 Answers0