Add this,then it should work.
Or can just .zip to one file,and share that.
It depend one use case a singe .exe is easy to share a,but many will not a run a executable .exe if not sure what is.
A installer(that also has a uninstaller) also make some Doc,is the professional looking way if want to share in a larger scale.
from PyQt5 import QtWidgets, uic import sys, os if getattr(sys, 'frozen', False): os.chdir(sys._MEIPASS) class HelloApp(object): def __init__(self, app): self.app = app self.ui = uic.loadUi('helloGUI.ui') self.ui.show() self.run() def run(self): self.app.exec_() if __name__ == "__main__": app = QtWidgets.QApplication(sys.argv) HelloApp(app)In many cases for lager prosje is better to use
--onedir
,then do not need to fix _MEIPASS
(the path that a single .exe will use)pyinstaller --clean --windowed --onedir --add-data helloGUI.ui;. qt_code.pyThen later can eg pack it with eg Inno Setup then get single
setup.exe
which has a installer.Or can just .zip to one file,and share that.
It depend one use case a singe .exe is easy to share a,but many will not a run a executable .exe if not sure what is.
A installer(that also has a uninstaller) also make some Doc,is the professional looking way if want to share in a larger scale.