I'm using pyinstaller vers 4.6 to build a MacOS app bundle. I have a pBuyIt.ui template file from Qt Designer that my pBuyIt.py program loads using uic.loadUiType('pBuyIt.ui'). The program runs correctly from PyCharm.
I'm packaging the MacOS app bundle using this command line:
pyinstaller --onedir --add-data pBuyIt.ui:. --windowed --icon pBuyIt.icns pbuyit.py
I get the following error in the system.log when I run pBuyIt:
Nov 1 14:27:17 iMac-2 pbuyit[24398]: Traceback:
Traceback (most recent call last):
File "pbuyit.py", line 78, in <module>
File "PyQt5/uic/__init__.py", line 200, in loadUiType
File "PyQt5/uic/Compiler/compiler.py", line 111, in compileUi
File "PyQt5/uic/uiparser.py", line 1020, in parse
File "xml/etree/ElementTree.py", line 1229, in parse
File "xml/etree/ElementTree.py", line 569, in parse
FileNotFoundError: [Errno 2] No such file or directory: 'pBuyIt.ui'
When I look in the pBuyIt.app bundle that is built, pBuyIt.ui is in pBuyIt.app/Contents/MacOS directory.
Appreciate help with how to specify the data file pBuyIt.ui to end up in the right place.
(P.S. When I run ./pbuyit from .../dist/pBuyIt directory in Terminal, it runs properly. The .ui file is in that same directory.)