我用python编写了一个脚本,使用win32print
模块在Windows上打印某些内容。我用下面的setup.py
冻结了它:
import sys
from cx_Freeze import setup, Executable
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"include_msvcr":True,'includes':['win32print','win32ui']}
setup(name='scoate',
version='0.1',
options={"build_exe": build_exe_options},
description='scoate la printer',
executables=[Executable('sand2.py', base=base)]
)
我在Windows7上运行了exe,运行良好。当我把程序复制到我爸爸的Windows XP上时,它会弹出错误:
^{pr2}$以下是生成的文件:
library.zip
mfc100u.dll
msvcp100.dll
MSVCR100.dll
PIL._imaging.pyd
PIL._imagingft.pyd
python34.dll
sand2.exe
unicodedata.pyd
win32print.pyd
win32ui.pyd
_bz2.pyd
_hashlib.pyd
_lzma.pyd
plot.py
中的第1行是"import win32print"
。但是正如您所看到的,它存在于生成的文件中。怎么了?在
PS如果我把'includes':[...]
从setup.py
中删除,那是一样的。我尝试用pyinstaller
冻结它,它在另一台机器上运行正常,但是pyinstaller
不支持python3
。在
目前没有回答
相关问题 更多 >
编程相关推荐