如何识别执行使用py2exe模块生成的exe文件所需的.pyd文件

时间:2016-10-05 14:35:43

标签: python pydev py2exe pillow pyd

我编写了一个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

任何形式的帮助都将受到赞赏!!!

谢谢, 拉姆

1 个答案:

答案 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,因为我不太确定那些。

相关问题