问题
I had just finished coding coding a small project. This same project which i had coded earlier was 6 Mb in .exe after using pyinstaller but in the latest iteration of code i had made very little changes. Now the the file size of the .exe is 307Mb after i have compiled with pyinstaller. My question is, what could have caused this drastic increase in file size?
I am looking for any possible explanation.
These are the imports i am using:
import pdfkit
import datetime as date
import calendar
import os.path
import getpass
from pandas import to_datetime
from dateutil.relativedelta import *
This is my spec file:
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(['test.py'],
pathex=['C:\\Users\\..\..\..\..Scheduler'], #I have hidden the full path
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
[],
exclude_binaries=True,
name='test',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='test')
来源:https://stackoverflow.com/questions/62013903/file-size-increased-after-making-very-small-changes-to-code-and-compiling-with-p