UN-GCPDS / qt-material

Material inspired stylesheet for PySide2, PySide6, PyQt5 and PyQt6
https://qt-material.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
2.3k stars 242 forks source link

Error when packaging with PyInstaller #4

Closed maicol07 closed 4 years ago

maicol07 commented 4 years ago

Getting this error when opening a script packaged with pyinstaller:

Traceback (most recent call last):
 File "main.py", line 25, in <module>
 File "c:\users\maicol\.conda\envs\modpack_sphaxifier\lib\site-packages\pyside_material\__init__.py", line 158, in list_themes
   os.path.dirname(os.path.abspath(__file__)), 'themes'))
FileNotFoundError: [WinError 3] Can't find the specified path: 'D:\\Maicol\\Documents\\Progetti\\Windows\\Modpack_Sphaxifier\\dist\\main\\pyside_material\\themes'

It seems that __file__ returns the current script, not pyside-material script

maicol07 commented 4 years ago

It seems that you need to add the themes folder as data to pyinstaller bundle