You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Multiprocessing problems with flet build windows executable #3547
I have searched the opened issues and there are no duplicates
Describe the bug
Hello Flet community,
I am using multiprocessing in my app, but after build the executable using flet build windows, and run the resulting executable, it shows the following error with 2 flet windows.
PathAccessException: Deletion failed, path = 'C:\Users\XUYI27~1\AppData\Local\Temp\multi-1.0.0-1\app' (OS Error: The process cannot access the file because it is being used by another process.
, errno = 32)
Code
Below is a demo I wrote to demonstrate this problem. My actual app also uses Process, Queue and Event from multiprocessing.
A Test control with random number added to the app window every second, the same behavior as running the python script using python main.py or flet run
This is now resolved in Flet 0.86.0 (#6662). Docs: https://flet.dev/docs/cookbook/multiprocessing
Packaged desktop apps now detect Python multiprocessing child invocations before Flutter starts and run them using a headless embedded Python interpreter. This prevents worker processes from opening additional Flet windows or locking the unpacked application directory.
Your example already seems to follow the main requirements: the worker is defined at module level and the Flet entry point is protected by if name == "main":. freeze_support() is no longer required, although leaving it there is harmless. Please upgrade to Flet 0.86.0 or newer and rebuild the Windows application. Let know if you face further issues.
Activity
ndonkoHenri commentedon Aug 17, 2026
This is now resolved in Flet 0.86.0 (#6662). Docs: https://flet.dev/docs/cookbook/multiprocessing
Packaged desktop apps now detect Python multiprocessing child invocations before Flutter starts and run them using a headless embedded Python interpreter. This prevents worker processes from opening additional Flet windows or locking the unpacked application directory.
Your example already seems to follow the main requirements: the worker is defined at module level and the Flet entry point is protected by if name == "main":. freeze_support() is no longer required, although leaving it there is harmless. Please upgrade to Flet 0.86.0 or newer and rebuild the Windows application. Let know if you face further issues.