I am currently working on an application that uses py2exe to make an exe file from a small Python code that uses matplotlib. It works very well, except that my executables are massive. Performing the conversion script below, it creates 43.5 MB of the package (exe and its dependencies). I know that there are some things that can be done to reduce the size of my application.
Any tips on reducing the size of my application?
My conversion script:
from distutils.core import setup import py2exe import matplotlib setup( windows=[{'script': r'ElectronOrbitalGenerator.py'}], data_files=matplotlib.get_py2exe_datafiles(), options={r'py2exe':{r'includes': r'ElementConfig', r'includes': r'ColorConv', r'includes': r'Tkinter', r'includes': r're', r'includes': r'math', r'includes': r'sys', r'includes': r'matplotlib', r'includes': r'mpl_toolkits', r'dll_excludes': [r'MSVCP90.dll'], }}, )
These are all the modules that my program should execute:
import ElementConfig, ColorConv import Tkinter, re, math, sys import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.figure import Figure
source share