0

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

任何形式的帮助将不胜感激!!!

谢谢,拉姆

4

1 回答 1

0

您可以通过添加options参数来包含模块setup

    options = {'py2exe': {'bundle_files': 1, 'compressed': True, "includes" : ['os', 'sys', 'math', 'aggdraw', 'PIL', 'xml.etree.ElementTree', 'lxml.etree' ]}
   }

上面代码中唯一可能不同的是,您可能需要替换xml.etree.ElementTreexmllxml.etreelxml因为我不太确定这些。

于 2016-10-05T16:32:14.980 回答