v6.10.0 `_MEIPASS2` in onedir application

Author: arossertCreated Aug 13, 2024Updated Apr 12, 2026
Labelsfeature

I have an issue with the latest release which might not be a bug but the behavior was changed, I have a weird use case (hard to explain) when I use onedir application that in some cases needs to be executed from a different location, what I'm doing now (until v6.10.0) it copying only the .exe file to the new location, set the _MEIPASS2 env var to point to the original application directory and execute the new file from the new location.

Up until the latest version (v6.10.0) this worked without any issues, not with the changes in #8634 this stopped working, I tried to set the _PYI_APPLICATION_HOME_DIR env instead of the _MEIPASS2 one, set PYINSTALLER_RESET_ENVIRONMENT but nothing worked.

The error is that it tries to load the python38.dll file from the current directory instead of the original one, if I change the CWD of the new process it works but in some cases I need it to be the new directory.

As I mentioned, I know that this is a weird use-case but you can retain this flow with the new mechanism it will be awsome

  • Version of Python: 3.8
  • Platform: Windows