I googled for my problem and it lead me here: Bundling data files with PyInstaller (--onefile)
So I added the accepted answer's code,
def resource_path(relative):
return os.path.join(
os.environ.get(
"_MEIPASS2",
os.path.abspath(".")
),
relative
)
# in development
>>> resource_path("app_icon.ico")
"/home/shish/src/my_app/app_icon.ico"
# in deployment
>>> resource_path("app_icon.ico")
"/tmp/_MEI34121/app_icon.ico"
But I still receive a cannot locate imageName
error. With the exception that it lists the _MEIPASS
folder.
Is there something I'm missing?
Let me know if more info is needed. As far as I'm concerned, pyinstaller
is black magic, so I'm unsure what would be relevant info.