该文件的版本与Windows版本不兼容

问题描述:

我在windows10中编写了一个python 3.6.2程序,我将它转换成Cx_Freeze.i的.exe文件,写下了波纹管代码来转换它: from cx_Freeze import设置,可执行该文件的版本与Windows版本不兼容

import os 
import sys 
os.environ['TCL_LIBRARY'] = r'C:\Users\seyed_vahid\AppData\Local\Programs\Python\Python36\tcl\tcl8.6' 
os.environ['TK_LIBRARY'] = r'C:\Users\seyed_vahid\AppData\Local\Programs\Python\Python36\tcl\tk8.6' 
packages = ['idna','queue.py'] 
include_files=[r'C:\Users\seyed_vahid\AppData\Local\Programs\Python\Python36\DLLs\tcl86t.dll',r'C:\Users\seyed_vahid\AppData\Local\Programs\Python\Python36\DLLs\tk86t.dll',r'C:\Users\seyed_vahid\AppData\Local\Programs\Python\Python36\sticker.png',r'C:\Users\seyed_vahid\AppData\Local\Programs\Python\Python36\about.png',r'C:\Users\seyed_vahid\AppData\Local\Programs\Python\Python36\emoji1.png',r'C:\Users\seyed_vahid\AppData\Local\Programs\Python\Python36\telegram.png'] 
base = None 
if (sys.platform == "win32"): 
    base = "Win32GUI" 
setup(name = "MegaGram", 
    version = "1.0.0", 
    description = "MegaGram", 
    options = {'build_exe': {'packages':packages, 
     'include_files':include_files}}, 
    executables = [Executable("MegaGram.py",base=base,icon = 'icon.ico',)], 
) 

但在Windows 7(32位)运行exe文件时,我得到波纹管错误:

The version of this file is not compatible with the version of windows you are running cheak your computers system information to whethers you need an x86 or x64 version of the program,and then 
contact the software publisher. 

如何解决?

+0

您的Python版本是32位还是64位? –

+0

@Michael Butscher它是64位。 – naghi

cx_freeze将Python和二进制模块打包到最终的程序中,因此它变成了64位的exe文件,无法在32位操作系统下运行。

安装一个32位Python,并使用它与cx_freeze一起创建一个工作程序。