Skip to main content

Pyinstaller and qpageview

I have a PyQt5 project where I am using qpageview. I am working on Ubuntu Linux and I am trying to run PyInstaller to make a single executable file, for convenience for me. The application works fine if I run it from a virtual environment, or with all of the Python modules installed locally to my machine (no virtual environment). It has a problem, however, if I run the executable produced by the command pyinstaller -F src/main.py, the executable dist/main, it runs without any errors, but the actual Page View is just blank, as though there is no PDF.

I have made an simple example application that experiences this phenomenon here (my actual app is much larger than this and has multiple files):

from PyQt5.QtWidgets import QApplication
import qpageview

app = QApplication([])

v = qpageview.View()
v.resize(900, 500)
v.show()

v.loadPdf("pyqt.pdf")

app.exec()

This assumes there is a PDF at the current working directory called "pyqt5.pdf". Does anyone know how to fix this issue?

Thanks!



source https://stackoverflow.com/questions/76492985/pyinstaller-and-qpageview

Comments