notice the exe and other files generate by Pyinstaller is really big file size,
my script is 2k but the file generated is 500MB.
how to reduce the size?
my script is 2k but the file generated is 500MB.

how to reduce the size?
pyinstaller exe size
|
||||||||||||||||||||||||||
notice the exe and other files generate by Pyinstaller is really big file size,
my script is 2k but the file generated is 500MB. ![]() how to reduce the size?
Dec-08-2017, 09:52 AM
Reducing the imports. If you've big modules, they are also put into the distribution.
Which imports do you have?
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
A normal small script with example using Tkinter.
Pyinstaller make a single .exe around 8-10MB. As mention bye DeaD_EyE have to look at your import,at whats needed and what can be excluded. (Dec-08-2017, 09:52 AM)DeaD_EyE Wrote: Reducing the imports. If you've big modules, they are also put into the distribution. i would like to import modules below; how I code it for smaller size? i am using pyinstaller. from tkinter import * from tkinter import filedialog import tkinter.ttk as ttk import os import pandas as pd import glob from pandas import ExcelWriter from pandas import ExcelFile import time, sys
Dec-15-2017, 03:52 AM
If your doing pandas under anaconda, try not using anaconda to build the exe.
Recommended Tutorials:
(Dec-15-2017, 03:47 AM)issac_n Wrote: how I code it for smaller size? i am using pyinstaller.You using pandas that can have a lot of dependencies. Like is using Numpy+MKL(it can use 200mb) more that may not be need. So just install numpy alone. To have control over dependencies must use virtual environment. I have tested with all your import and my file size with all for one .exe file is 23.4MB .Here is the whole setup,i use virtual environment that's build into 3.6. There are basic dependencies that pandas need. Dependencies:
Setup virtual environment,i use cmder but is just the same commands in cmd:
Installing dependencies:
work_data.py (that use pandas) in environment to make sure that all import work.I build with:
Open spec(auto generated every time run pyinstaller) file and add:
work_data.exe that run pandas and size is 23.4MB .
(Dec-15-2017, 04:33 PM)snippsat Wrote:(Dec-15-2017, 03:47 AM)issac_n Wrote: how I code it for smaller size? i am using pyinstaller.You using pandas that can have a lot of dependencies. I follow all instructions and manage to generate exe without Error and it is 200MB. ![]() did I miss out something? ![]() possible to further minimize the size? (Dec-18-2017, 10:17 AM)issac_n Wrote: I follow all instructions and manage to generate exe without Error and it is 200MB.You most have,what the size of you build_env folder?Mine are 174MB this is with all libraries and the build work_data.exe 23.4MB.All should be run from that folder,you can check site-packages folder,and see that pandas ans numpy has normal size pandas(43mb), numpy(27MB). When virtual environment is activate all should be used from that folder. I use cmder who has which command.
(Dec-18-2017, 04:27 PM)snippsat Wrote:(Dec-18-2017, 10:17 AM)issac_n Wrote: I follow all instructions and manage to generate exe without Error and it is 200MB.You most have,what the size of you I notice my site-packages folder is empty and the exe file is in dist folder; and is return <root> instead of " <build_env>" after activate it; u can click the image link for full image. will pm the full script to u.
I have tested with code you send me,and i make a working .exe of that code with size of
23.4MB .The problem is that you are doing something wrong when making the environment. Here is all step taken from cmd ,run cmd as administrator.Python version used is 3.6 as shown in tutorial here and part-2 has info about virtual environment. Start cmd
| ||||||||||||||||||||||||||
|