-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It doesnt work when exporting for exe using pyinstaller :( #25
Comments
Can you please provide the error logs? |
Any changes? |
I'm yet to try your steps. Will update you soon. |
Has anyone had luck wrapping this into an exe with pyinstaller? |
Just built a .exe with pyinstaller with a project that utilized this package and had no issues building or running the executable. I will post my system info below but suggest the OP post more info and/or possibly their project as it may be a configuration issue. Otherwise this seems like a non-issue System Info:
|
still not working here. https://pastebin.com/RpN0U4DA |
@maguila93 your issues seem to be related to a configuration issue and not necessarily an issue with this library. If you may, lets do an experiment to figure out of this is the case or not. Create a single python script in a new and empty folder that contains the following code: from win10toast import ToastNotifier
toaster = ToastNotifier()
toaster.show_toast(
"Testing pyinstaller",
"Trying to find root cause",
duration=10) Run the above script in the typical fashion: and verify that the popup shows as expected. Assuming the script works as expected lets try and built it into an EXE with pyinstaller: If you get any errors from this let us know, otherwise if this works and your EXE runs we know it is an issue with your previous project and not in this package itself. If the EXE builds but does not show a popup attempt to run the EXE from a cmd prompt and share the error message |
@BroderickCarlin I did exactly what you said and I got a new error :( |
@maguila93 run the script from a cmd window to see what error is stopping the EXE from running. |
@BroderickCarlin can you please try to complite to exe, test it and upload it? |
@maguila93 I think it would be better if you chased down whatever problem you are having and find the root cause of your issue. I am not going to do this for you, sorry. I suggest getting that toy script I posed above to build/run as I believe when you get this working you will figure out the reason as to why your other project(s) are not building. The error logs posted seem to indicate more issues than just this package. @jithurjacob At this point I think this issue can be closed as it appears to be an issue in @maguila93 's environment or project architecture and not actually an issue with this package. |
@BroderickCarlin thanks a lot for the following this up |
I can confirm it doesn't work when running pyinstaller on win7. Resulting exe doesn't show notifications niether on win7 nor on win8.1. When I run pyinstaller on win8.1 it's fine with Windows-10-Toast-Notifications, but then exe wouldn't start on win7, so not an option for me. |
@7ko Do you have your project wrapped in an anaconda environment? Give that a shot and report back |
I am getting below error while i click on the exe which have below code Code : Error : Traceback (most recent call last): |
@BroderickCarlin hi sorry for the late reply I was on vacation and then it took me some time to figure out the Anaconda thing. I have a little correction on my previous statement on the problem. The toast does not show after using pyinstaller with neither win8.1 nor win7 environment. However, the was an exception I failed to notice because I used 'console=False' clause. Exception in thread Thread-1: From this I suspected that the problem is with the icon. No icon_path parameter to show_toast() or None has win10toast module reaching to win10toast/data/python.ico resource which appears to be missing in case of pyinstaller application. Adding a valid icon (i.g. icon_path='SINEWAVE.ICO') solved the problem nicely. |
@7ko , thanks for the follow up! I hadn't even considered that this may be related to the icon file but I am glad that resolved all the issues we have been seeing. The simple solution here would be just to try and silently handle the situation where we can not find the icon file. |
I have used this command
|
hello , i'm also facing the same issue, |
Any news? |
thanks, I solved it providing an icon path with a custom icon. It is also working providing an invalid path. You get an error printed but the pop-up is still working without an icon. |
pkg_resources.DistributionNotFound: The 'win10toast' distribution was not found and is required by the application |
EDIT: I was looking for the place, where the icon path has to be provided. I am already setting it, but to "None" like this:
Changing the icon_path to '' instead of None fixed the problem.
|
uhh ignore it |
This fixed the error for me! |
Yeah just do not leave out icon_path in the attributes and also do not give value as None. Either give any icon path or just give blank string as ''. |
Or am I doing it wrong?
The text was updated successfully, but these errors were encountered: