Thanks for the reply!

For my use case, the fact that the temp directory would be cleaned when the
parent application exits would not be an issue because the child process
lifespan is always shorter than the parent.

However, what I see is that the child process doesn’t inherit the temp
directory or at least not use it to search for the modules. I tried setting
the reset environment variable but I still face the same exception.

I should note that this application is not bundled as a onefile application
but as onedir. If you can offer some further guidance on this, I would
really appreciate it! Thanks.

În joi, 14 aug. 2025 la 23:18 bwoodsend <[email protected]> a scris:

> A onefile application runs in a temporary directory so tampering with the
> original executable would go unnoticed (although I wouldn’t call that
> guaranteed behaviour). That temporary directory would be inherited by the
> multiprocessing child but also be cleaned up when the original process
> exits. You'd really want your subprocess to re-extract and run in a fresh
> temporary directory so subprocess.run([sys.executable],
> env={**os.environ, "PYINSTALLER_RESET_ENVIRONMENT": "1"}) might do it
> (although this kind of application self-management/auto updating is
> something I wish people would just stop doing so I’m not feeling
> particularly minded to prove it out).
> ​
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "PyInstaller" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/pyinstaller/JpJALIrfqgw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/pyinstaller/a43cb133-14bc-4e0b-8df0-9372fdd962ean%40googlegroups.com
> <https://groups.google.com/d/msgid/pyinstaller/a43cb133-14bc-4e0b-8df0-9372fdd962ean%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/pyinstaller/CAJnnM-y3jyATonRmrTe21nZEoux57p2e%2BANudzp3swynBSWnzQ%40mail.gmail.com.

Reply via email to