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

Pyinstaller Error #10

Open annielo opened 3 years ago

annielo commented 3 years ago

i use python 3.6.1 pyinstaller 4.0 after packaged to exe, i got the error message: [WinError 3]The system cannot find the path specified: '...\qt-material\fonts' please help to fix, thanks

JackPieCZ commented 3 years ago

Just add the qt-material folder to export with --add-data "path/to/folder/qt_material/"

FuturisticGoo commented 3 years ago

@YeisonCardona I think it would be better to add pyinstaller packaging guide to the README, given the amount of issues regarding the same

YeisonCardona commented 3 years ago

Hi @FuturisticGoo, I think so, but in all cases is solved by reading the PyInstaller documentation.

bebert64 commented 3 years ago

Hi. Would you be open to a pull request if I wrote a hook + the setup entry point for pyinstaller, grabbing all the necessary data ? This way, no need for anyone to add anything in the spec.

YeisonCardona commented 3 years ago

Hi @bebert64 That's would be awesome, all users will appreciate it, please add an example too ;)

bebert64 commented 3 years ago

Hi. It's the very first time I'm contributing to a project, so I apologize in advance if there is something I'm doing wrong (hope not !). I've created the pull request, I'll let you take a look whenever you can. About the example : the idea of the hook is that nothing more is necessary to include qt-material in your pyinstaller, so I'm not sure what I should write. There is no mention of qt-material anywhere, either in my setup.py file nor in the pyinstaller .spec file.

nicoddemus commented 3 years ago

@bebert64,

Thanks for stepping up to help with this, but IMHO it would be better to contribute a PR to https://github.com/pyinstaller/pyinstaller-hooks-contrib.

This way things would just work out of the box, without users having to configure anything.

bebert64 commented 3 years ago

Awesome ! I'm really new to this so I really appreciate anything pointing me in the right direction. I'll take a look this weekend. Thanks !

On Wed, Jun 2, 2021 at 12:36 AM Bruno Oliveira @.***> wrote:

@bebert64 https://github.com/bebert64,

Thanks for stepping up to help with this, but IMHO it would be better to contribute a PR to https://github.com/pyinstaller/pyinstaller-hooks-contrib.

This way things would just work out of the box, without users having to configure anything.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/UN-GCPDS/qt-material/issues/10#issuecomment-852528971, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOEQB2Y4GDBZLYZNV445JG3TQVOGDANCNFSM4VFHGIVQ .

nicoddemus commented 3 years ago

No problem!

I think contributing a file hook-qt_material.py with this:

from pkg_resources import resource_filename

datas = [
    (resource_filename("qt_material", "fonts"), "qt_material/fonts"),
    (resource_filename("qt_material", "themes"), "qt_material/themes"),
    (resource_filename("qt_material", "resources"), "qt_material/resources"),
    (resource_filename("qt_material", "material.css.template"), "qt_material"),
]

Would work already. 👍

noah-peeters commented 2 years ago

Hi

I encountered a similar error when upgrading qt-material to v2.10. Downgrading to v2.9 works, but I'd like to use the latest version. Why doesn't the older version have the same issue? Here's the output:

Traceback (most recent call last):
  File "src/run.py", line 58, in <module>
  File "src/run.py", line 41, in main
  File "src/MainWindow/MainWindow.py", line 54, in __init__
  File "src/MainWindow/SettingsWidget.py", line 90, in __init__
  File "src/MainWindow/SettingsWidget.py", line 65, in __init__
  File "src/MainWindow/SettingsWidget.py", line 75, in config_updated
  File "qt_material/__init__.py", line 108, in apply_stylesheet
  File "qt_material/__init__.py", line 101, in add_fonts
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/wz/jjfy6f7d1vg3swvd_k27l1gr0000gn/T/_MEI1yXx51/qt_material/fonts'
[14205] Failed to execute script 'run' due to unhandled exception: [Errno 2] No such file or directory: '/var/folders/wz/jjfy6f7d1vg3swvd_k27l1gr0000gn/T/_MEI1yXx51/qt_material/fonts'
[14205] Traceback:
Traceback (most recent call last):
  File "src/run.py", line 58, in <module>
  File "src/run.py", line 41, in main
  File "src/MainWindow/MainWindow.py", line 54, in __init__
  File "src/MainWindow/SettingsWidget.py", line 90, in __init__
  File "src/MainWindow/SettingsWidget.py", line 65, in __init__
  File "src/MainWindow/SettingsWidget.py", line 75, in config_updated
  File "qt_material/__init__.py", line 108, in apply_stylesheet
  File "qt_material/__init__.py", line 101, in add_fonts
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/wz/jjfy6f7d1vg3swvd_k27l1gr0000gn/T/_MEI1yXx51/qt_material/fonts'
Yongle-Fu commented 4 months ago

https://github.com/UN-GCPDS/qt-material/issues/113 any solution ?

nicoddemus commented 4 months ago

The solution is here: https://github.com/UN-GCPDS/qt-material/issues/10#issuecomment-852901254

Someone just needs to take some time and contribute that to https://github.com/pyinstaller/pyinstaller-hooks-contrib.