简体   繁体   中英

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. The script executes fully when running in Python, but when I run it as an exe I get this error:

ImportError: You must install PIL to fetch image objects

PIL is needed for another package I run in my script, openpyxl. I am on the latest version of openpyxl (2.4.2).

Here is my bbfreeze import script:

   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'))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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