I am learning how to code in python and have written a script that generates charts using Pandas and Plotly/Kaledio. I was able to convert the python script into a windows executable however the distributable folder size is around 250MB, I was wondering if there is a way for me to be able to reduce this size.
I have created a virtual environment to reduce the number of libraries included, and have also tried using Plotly offline plots to output the images, which reduces the distribution folder size to around 130MB, but then it also adds the process of saving the images from the html files which are low quality.
I would like to be able to output png or jpg files directly therefore using Kaleido but that increases the distributable size substantially, would anyone know how I can possibly reduce the file size ?
Imports:
import pandas as pd
import plotly.express as px
import glob
import sys
import os
Analysis section of the asset file, adding Plotly and Kaleido in data since Pyinstaller wouldn't pick them up.
a = Analysis(['main.py'],
pathex=['C:\\Users\\Coding\\PycharmProjects\\charts'],
binaries=[],
datas=[('C:\\Users\\Coding\\PycharmProjects\\charts\\venv\\Lib\\site-packages\\plotly\\', 'plotly'),
('C:\\Users\\Coding\\PycharmProjects\\charts\\venv\\Lib\\site-packages\\kaleido\\', 'kaleido'),],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=['statmodels', 'setuptools', 'scipy', 'pyinstaller', 'pyinstaller-hooks-contrib', 'python-dateutil','tkinter'],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
Any and all help is appreciated.
Edit: Forgot to add IDE I'm using is PYCharm, with python 3.7 packages were installed using PIP