简体   繁体   English

PIL软件包未使用bbfreezer安装

[英]PIL package not installing using bbfreezer

I am trying to package a Python 2.7 script into an exe so that it can be run in environments that do not have Python natively installed. 我正在尝试将Python 2.7脚本打包到exe中,以便可以在没有本地安装Python的环境中运行。 The script executes fully when running in Python, but when I run it as an exe I get this error: 该脚本在Python中运行时会完全执行,但是当我将其作为exe运行时,出现此错误:

ImportError: You must install PIL to fetch image objects

PIL is needed for another package I run in my script, openpyxl. 我在脚本openpyxl中运行的另一个软件包需要PIL。 I am on the latest version of openpyxl (2.4.2). 我正在使用最新版本的openpyxl(2.4.2)。

Here is my bbfreeze import script: 这是我的bbfreeze导入脚本:

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

Any help would be appreciated. 任何帮助,将不胜感激。 Thanks. 谢谢。

使用bbfreeze导入PIL时,在编写脚本时,还要求'pkg_resources','numbers'和'pipes'是“ includes”子句的一部分。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM