build of python toasts do not show

Viewed 14

my multiproccesed tkinter app involves toasts. The toast work fine in idle.

however they throw an error when running from a build

pkg_resources.DistributionNotFound: The 'pywin32>=223' distribution was not found and is required by pypiwin32

the common solution online is to try alternatives to pypiwin32, but that doesnt seem to do me any good.

my full code is below

import win32com.client as pypiwin32
from tkinter import *
from multiprocessing import Process, Manager , freeze_support
from win10toast import ToastNotifier

if __name__ == '__main__':
    freeze_support()
    window=Tk()
    window.title('choose a car')
    window.geometry("820x550+10+20")
    canvas=Canvas(window, width=360, height=300)
    canvas.pack()
    toaster = ToastNotifier()
    toaster.show_toast("bout to start ", "start msg" , threaded=True)
    print("done :)     ")

the full error is below.

C:\Users\jack.flavell\Desktop\New folder (9)\ui price comper 0.57\build\exe.win-amd64-3.9>"toast test.exe"
done :)
Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Users\jack.flavell\AppData\Local\Programs\Python\Python39\lib\threading.py", line 973, in _bootstrap_inner
    self.run()
  File "C:\Users\jack.flavell\AppData\Local\Programs\Python\Python39\lib\threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\jack.flavell\AppData\Local\Programs\Python\Python39\lib\site-packages\win10toast\__init__.py", line 93, in _show_toast
    icon_path =  resource_filename(Requirement.parse("win10toast"), "win10toast/data/python.ico")
  File "C:\Users\jack.flavell\AppData\Local\Programs\Python\Python39\lib\site-packages\pkg_resources\__init__.py", line 1130, in resource_filename
    return get_provider(package_or_requirement).get_resource_filename(
  File "C:\Users\jack.flavell\AppData\Local\Programs\Python\Python39\lib\site-packages\pkg_resources\__init__.py", line 342, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "C:\Users\jack.flavell\AppData\Local\Programs\Python\Python39\lib\site-packages\pkg_resources\__init__.py", line 886, in require
    needed = self.resolve(parse_requirements(requirements))
  File "C:\Users\jack.flavell\AppData\Local\Programs\Python\Python39\lib\site-packages\pkg_resources\__init__.py", line 772, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pywin32>=223' distribution was not found and is required by pypiwin32

also here is my cx_freeze script i used to make the build

from cx_Freeze import setup, Executable
setup(
    name = "big ui system" ,
    version = "0.1" ,
    description = "a ui to tie together some web scrappers " ,
    executables = [Executable("toast test.py")]
      )

how can i get these toasts to show on the build of this programme?

0 Answers
Related