PythonのReportLabのソースをpy2exeでexe化する際のメモ

setup.pyのsetup()のoptionsでpackagesを指定する必要がある。

# coding: cp932
# setup.py
from distutils.core import setup
import py2exe

packages=[
	'reportlab',
	'reportlab.graphics.charts',
	'reportlab.graphics.samples',
	'reportlab.graphics.widgets',
	'reportlab.graphics.barcode',
	'reportlab.graphics',
	'reportlab.lib',
	'reportlab.pdfbase',
	'reportlab.pdfgen',
	'reportlab.platypus',]
	
py2exe_options = {
  "compressed": 1,
  "optimize": 2,
  "bundle_files": 1,
  "packages": packages}

setup(
  options = {"py2exe": py2exe_options},
  console = [
    {"script" : "hoge.py"}],
  zipfile = None)