Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pyinstaller's 'onedir' mode creates too many files

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?

like image 880
Mat Fluor Avatar asked Apr 12 '14 08:04

Mat Fluor


People also ask

What are hidden imports?

Listing Hidden Imports If Analysis thinks it has found all the imports, but the app fails with an import error, the problem is a hidden import; that is, an import that is not visible to the analysis phase. Hidden imports can occur when the code is using __import__() , importlib.

Can I delete build folder PyInstaller?

You can delete build and dist , after you got the exe out.

Why is PyInstaller EXE so slow?

PyInstaller's bootloader is usually quite fast in one-dir mode, but it can be much slower in one-file mode, because it depacks everything into a temporary directory. On Windows, I/O is very slow, and then you have antiviruses that will want to double check all those DLL files. PyQt itself is a non-issue.

How to set Icon in PyInstaller?

Use the --icon argument to specify a custom icon for the application. It will be copied into the Resources folder. (If you do not specify an icon file, PyInstaller supplies a file icon-windowed. icns with the PyInstaller logo.)


1 Answers

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

like image 98
Leandro Lara Tiago Avatar answered Oct 25 '22 01:10

Leandro Lara Tiago