PIL 包不使用 bbfreezer 安装

PIL package not installing using bbfreezer

我正在尝试将 Python 2.7 脚本打包到一个 exe 中,以便它可以 运行 在未安装 Python 的环境中。在 Python 中 运行ning 时脚本完全执行,但是当我 运行 它作为 exe 时,我得到这个错误:

ImportError: You must install PIL to fetch image objects

我的脚本 openpyxl 中的另一个包 I 运行 需要 PIL。我使用的是最新版本的 openpyxl (2.4.2)。

这是我的 bbfreeze 导入脚本:

   from bbfreeze import Freezer
   f = Freezer("AthenaHighDef", includes('csv','datetime','sqlite3','calendar','operator', 'os', 'dateutil', 'openpyxl', 'PIL', 'winsound'))
   f.addScript ("athenahighdef.py")
   f()

如有任何帮助,我们将不胜感激。谢谢

使用bbfreeze 导入PIL 时,还要求'pkg_resources'、'numbers' 和'pipes' 在制定脚本时成为"includes" 子句的一部分。

f = Freezer("PilTest", includes=('PIL', 'pkg_resources', 'numbers', 'pipes'))