Reducing size of pyinstaller exe

前端 未结 4 1304
天涯浪人
天涯浪人 2020-11-29 23:21

I have a simple pandas pyinstaller exe which is over 40MB.

My exe example:

import collections
import csv
import selenium
import pandas

print(\'hi\')         


        
4条回答
  •  孤街浪徒
    2020-11-29 23:54

    The python interpreter and all imported modules are included in the executable.

    You can try adding modules you want to exclude to the excludes list under Analysis in your spec file.

    You could also try compressing the executable using UPX. See A note on using UPX

提交回复
热议问题