解决的方案是利用pyinstaller的hook特性,步骤如下: 1.在项目目录新建hooks目录,目录中新建hooks-scrapy.py 文件,文件内容如下: from PyInstaller.utils.hooks import collect_submodules, collect_data_files # This collects all dynamically imported scrapy modules and data files.hiddenimports = (colle…