为什么剂量cx_freeze会抛出像'MSIError'这样的异常

时间:2017-07-09 11:47:25

标签: python windows-installer cx-freeze

我遇到了关于将.py转换为.exe的问题。当我尝试使用cx_freeze打包时,我将永远得到'MSIError',这是这样的:

Traceback (most recent call last):
File "setup.py", line 15, in <module>
  setup(name="NumberCounter",version="1.0",description="无",options={"build_exe":build_options},executables=executables)
File "C:\Users\apple1\AppData\Local\Programs\Python\Python35\lib\site-packages\cx_Freeze\dist.py", line 349, in setup
  distutils.core.setup(**attrs)
File "C:\Users\apple1\AppData\Local\Programs\Python\Python35\lib\distutils\core.py", line 148, in setup
  dist.run_commands()
File "C:\Users\apple1\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 955, in run_commands
  self.run_command(cmd)
File "C:\Users\apple1\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 974, in run_command
  cmd_obj.run()
File "C:\Users\apple1\AppData\Local\Programs\Python\Python35\lib\site-packages\cx_Freeze\windist.py", line 392, in run
  self.add_files()
File "C:\Users\apple1\AppData\Local\Programs\Python\Python35\lib\site-packages\cx_Freeze\windist.py", line 133, in add_files
  cab.commit(db)
File "C:\Users\apple1\AppData\Local\Programs\Python\Python35\lib\msilib\__init__.py", line 220, in commit
  add_stream(db, self.name, filename)
File "C:\Users\apple1\AppData\Local\Programs\Python\Python35\lib\msilib\__init__.py", line 129, in add_stream
  r.SetStream(1, path)
_msi.MSIError: 1: 1101 2: C:\Users\apple1\AppData\Local\Temp\tmp5kgryuh8 3: 2

我该如何解决?为什么会这样?

1 个答案:

答案 0 :(得分:0)

我将为您解开错误行。

_msi.MSIError: 1: 1101 2: C:\Users\apple1\AppData\Local\Temp\tmp5kgryuh8 3: 2
  • 根据Windows Installer Error Messages,1101表示Could not open file stream: [2]. System error: [3]

  • 每个命令net helpmsg 2,系统错误2为The system cannot find the file specified

该路径似乎是应该创建的临时文件,但根据错误,它可能不是。您可以尝试使用Process Monitor之类的工具来确定临时文件是否正在发生什么。

我不知道有关cx_freeze的任何有用信息,但我知道Windows Installer对Unicode的支持有点令人惊讶;它很容易脱落。因此,我会担心你的description="无",并考虑将其设置为一个简单的ASCII字符串,只是为了看它是否有帮助。