我编写了一个python脚本,并在Windows 32位操作系统上使用py2exe生成了一个exe。当我尝试执行生成的exe文件时,我收到以下错误:
Traceback (most recent call last):
File "program01.py", line 3, in <module>
File "PIL\Image.pyc", line 67, in <module>
File "PIL\_imaging.pyc", line 12, in <module>
File "PIL\_imaging.pyc", line 10, in __load
ImportError: DLL load failed: The specified module could not be found.
有没有办法确定完整列表我的程序要执行的.pyd文件是什么。
以下是我的程序导入语句。
from __future__ import division
import os, sys, math, aggdraw
from PIL import Image
import xml.etree.ElementTree as ET
import lxml.etree as LETREE
任何形式的帮助都将受到赞赏!!!
谢谢, 拉姆
答案 0 :(得分:0)
您可以通过在options
中添加setup
参数来包含模块:
options = {'py2exe': {'bundle_files': 1, 'compressed': True, "includes" : ['os', 'sys', 'math', 'aggdraw', 'PIL', 'xml.etree.ElementTree', 'lxml.etree' ]}
}
上述代码中唯一可能不同的是,您可能需要将xml.etree.ElementTree
替换为xml
而将lxml.etree
替换为lxml
,因为我不太确定那些。