2017-04-19 66 views
0

我使用PyInstaller来生成我创建的.py文件的exe文件。Pyinstaller:编译时节省空间

问题是它生成一个70mb的文件夹,这是一个很多。

有没有办法节省空间?例如在dist文件夹中,我找到以下子文件夹:tcltk包;他们是否需要在那里,或者他们没有功能,可能会被删除?

您有任何建议可以减小尺寸吗?

enter image description here

一般来说,在那里,以节省空间,同时编制最佳做法?

回答

0

按照docs,你可以在规范文件传递的“排除”参数:

block_cipher = None 
a = Analysis(['minimal.py'], 
    pathex=['/Developer/PItests/minimal'], 
    binaries=None, 
    datas=None, 
    hiddenimports=[], 
    hookspath=None, 
    runtime_hooks=None, 
    excludes=None, 
    cipher=block_cipher) 
pyz = PYZ(a.pure, a.zipped_data, 
    cipher=block_cipher) 
exe = EXE(pyz,...) 
coll = COLLECT(...)