10

I am "compiling" my Python application for Windows with PyInstaller 2.1. I initially tried using onefile mode, but onefile takes a long time to startup (decompressing wx and matplotlib). With the onedir mode it's pretty fast (only a little bit slower than native python).

So I want to use onedir mode for faster startup times, but for the end-user it's difficult to find the actual *.exe file inside the huge amount of files located in the main directory (there are 98 files including the actual executable and it's manifest).

I want to make sure a non tech-savvy user can easily "double-click" the executable and work with this program (ease and portability) without a long disclaimer to "just ignore" the 97 other files there.

Is it possible to move all those "distracting" files into a subfolder? Or are there other ways to make it easy for the end-user to run this program?

Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
Mat Fluor
  • 467
  • 1
  • 6
  • 17
  • 2
    Related Article: [*PyInstaller – Separating the executable from the ‘onedir’*](http://unafaltadecomprension.blogspot.com/2014/07/pyinstaller-separating-executable-from.html), Issue on GitHub: [*Onedir with exe outside the dir*](https://github.com/pyinstaller/pyinstaller/issues/1048) – Stevoisiak Apr 17 '18 at 16:09

3 Answers3

1

maybe you could use onedir. The resulting folder you can put anywhere and create a shortcut to the user where it is more comfortable.

1

Easiest way to reduce the number of files created in --onedir mode would be to create a virtual environment and install only the necessary modules.

Srivatsav
  • 65
  • 6
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 30 '22 at 20:03
0

You could use some software to pack it into a one-file installer, such as Inno setup. You could also try to delete some files one by one (if the executable fails just undelete it). I figured out that almost half of the files can be deleted with the executable working fine.

Download Inno Setup from here.

YJiqdAdwTifMxGR
  • 123
  • 1
  • 11