当我尝试将.py转换为Windows可执行此类错误时 警告:无法读取注册表以找到必要的编译器设置 确保安装了Python模块winreg,win32api或win32con 错误:[Errno 2]没有这样的文件或目录:'/ usr / lib / python3.4 /distutils / command / wininst-6.0.exe',/ usr / lib / python3.4 /distutils / command / wininst-6.0。 exe不包含在Debian软件包中。
import sys
import os
from cx_Freeze import setup,Executable
def find_data_file(password_lst):
if getattr(sys, 'frozen', False):
datadir = os.path.dirname(sys.executable)
else:
datadir = os.path.dirname(__file__)
return os.path.join(datadir, password_lst)
base = None
includes = ['password_lst']
zip_inc = ['password_lst']
build_exe_options = {"packages": ["os"], "include_files": includes, "zip_includes": zip_inc}
setup( name = "test",
version = "0.1",
description = "test",
options = {"build_exe": build_exe_options},
executables = [Executable("dummy.py" , base=base )])
Warning: Can't read registry to find the necessary compiler setting
Make sure that Python modules winreg, win32api or win32con are installed
error: [Errno 2] No such file or directory: '/usr/lib/python3.4/distutils/command/wininst-6.0.exe', usr/lib/python3.4/distutils/command/wininst-6.0.exe not included in the Debian packages.