qt-material icon indicating copy to clipboard operation
qt-material copied to clipboard

Pyinstaller Error

Open annielo opened this issue 5 years ago • 12 comments

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

annielo avatar Dec 22 '20 07:12 annielo

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

JackPieCZ avatar Dec 22 '20 11:12 JackPieCZ

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

FuturisticGoo avatar Dec 22 '20 15:12 FuturisticGoo

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

YeisonCardona avatar Dec 22 '20 20:12 YeisonCardona

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.

bebert64 avatar May 07 '21 10:05 bebert64

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

YeisonCardona avatar May 07 '21 16:05 YeisonCardona

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.

bebert64 avatar May 07 '21 20:05 bebert64

@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.

nicoddemus avatar Jun 01 '21 22:06 nicoddemus

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 .

bebert64 avatar Jun 02 '21 08:06 bebert64

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. 👍

nicoddemus avatar Jun 02 '21 10:06 nicoddemus

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'

noah-peeters avatar Mar 16 '22 15:03 noah-peeters