Python Pyinstaller在包含PIL导入时创建大型EXE文件
我正在我的代码中进行以下导入Python Pyinstaller在包含PIL导入时创建大型EXE文件,python,python-imaging-library,pyinstaller,Python,Python Imaging Library,Pyinstaller,我正在我的代码中进行以下导入 import os import ctypes import logging import tkinter as tk from PIL import Image from time import sleep from shutil import copyfile from selenium import webdriver import tkinter.messagebox as message from selenium.webdriver.common.by
import os
import ctypes
import logging
import tkinter as tk
from PIL import Image
from time import sleep
from shutil import copyfile
from selenium import webdriver
import tkinter.messagebox as message
from selenium.webdriver.common.by import By
import selenium.webdriver.edge.options as edgeOptions
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from winreg import OpenKey,QueryValueEx,KEY_READ
from datetime import date
from datetime import timedelta
如果我注释掉我的第五个导入,即PIL,那么我会得到一个大约10MB大小的exe。但如果我尝试包含PIL,那么pyinstaller会花费大量时间,最终生成一个大的(大约230MB)exe文件。为什么会发生这种情况?我如何避免这种情况?使用pyinstaller的大文件大小似乎是一个非常常见的话题,你做过任何研究吗?我不仅使用来自PIL import Image的
,而且还使用来自PIL import ImageGrab的。但我的应用程序只有20M。跟踪pyinstaller还包括哪些内容?