大家好,我有一个 python 软件,我想冻结它以进行分发。问题是在用 cx_freeze 冻结它并运行它之后,它在我的开发计算机(win 7)上运行良好,但是当我将它发送到我的测试计算机(window XP sp3 32bit)时,它给了我这个错误
Traceback(mostresent call last):
File "C:Python27\lib\site-packages\cx_Freeze\initscripts\Console.py", line27, in <module?
File "timeTracker.py", line 555, in <module>
File "timeTracker.py", line 381, in __init__
File "timeTracker.py", line 427, in runTimeThread
File "timeTracker.py", line 494, in __init__
File "timeTracker.py", line 118, in __init__
File "C:Python27\lib\site-packages\pyttsx1.1-py2.7.egg\pyttsx\__init__.py", line 39, in init
File "C:Python27\lib\site-packages\pyttsx1.1-py2.7.egg\pyttsx\engine.py", line 45, in __init__
File "C:Python27\lib\site-packages\pyttsx1.1-py2.7.egg\pyttsx\driver.py", line 66, in __init__
File "C:Python27\lib\site-packages\pyttsx1.1-py2.7.egg\pyttsx\drivers\sapi5.py", line 37, in buildDriver
File "C:Python27\lib\site-packages\pyttsx1.1-py2.7.egg\pyttsx\drivers\sapi5.py", line 46, in __init__
File "C:Python27\lib\site-packages\win32com\client\__init__.py", line 317, in WithEvents
AttributeError: 'NoneType' object has no attribute 'CLSID'
这是我的 setup.py
import sys
from cx_Freeze import setup, Executable
includes =['atexit']
packages = ['pyttsx','win32com.server','win32com.client']
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup(
name = "timeTracker",
version = "1.0.0",
description = "Keep track of your time take control of your life",
options = {"build_exe" : {"includes" : includes, "packages": packages }},
executables = [Executable("timeTracker.py", base = base)])
在 setup.py 中,我尝试将“win32com.gen_py”添加到包列表中,但出现错误
No module call 'win32com.gen_py'