1

I am using an executable file generated with Pyinstaller from my Python script.

Every time I open it, it creates a folder named (for example) _MEI12345 in \AppData\Local\Temp.

How can I prevent the creation of that folder? Are there other (better) ways to create an executable file if I have to distribute it?

nicc96
  • 313
  • 2
  • 16
  • https://stackoverflow.com/questions/70405069/pyinstaller-executable-saves-files-to-temp-folder might be relevant here. – Andrew McClement May 13 '22 at 10:54
  • Thanks, but I've already seen that. It's not relevant in my case – nicc96 May 13 '22 at 11:13
  • Isn't it saying that the exe actually runs your code from within that temp directory, that's why the directory is being created? (I don't know how this behaviour might be changed, but it does seem relevant.) – Andrew McClement May 13 '22 at 11:17
  • https://pyinstaller.org/en/stable/operating-mode.html#how-the-one-file-program-works suggests that using https://pyinstaller.org/en/stable/usage.html#cmdoption-runtime-tmpdir might allow you to specify where the `_MEI....` folder gets created, if you would want to created it somewhere other than %localappdata%. Not sure that that is very helpful. – Andrew McClement May 13 '22 at 11:22
  • 1
    Thank you, but I don't want to create that folder, not creating it in another path – nicc96 May 13 '22 at 12:59

0 Answers0