运行 Python 二进制文件在 Windows XP 下

Run Python binaries under Windows XP

我将我的 PySide 应用程序编译为 x32 和 x64 模式,它在 Windows 7+ 下工作。但是我发现应用程序无法在 Windows XP 下启动。

我是否应该在规范文件中额外使用一些技巧?

app.spec 文件中显示的当前 PyInstaller 脚本:

pyinstaller src/app.spec

# -*- mode: python -*-
import os
import platform

from PySide import QtCore


onefile = False
console = False

platform_name = platform.system().lower()
app_name = {'linux': 'app',
            'darwin': 'app',
            'windows': 'app.exe'}[platform_name]

# Include imageformats plugins
plugins=os.path.join(os.path.dirname(QtCore.__file__), "plugins\imageformats")
static_files = Tree(plugins, 'plugins\imageformats')
static_files += [('app.ico', 'src\app.ico', 'DATA')]

# Analyze sources
a = Analysis(['src\app.py'],
             hiddenimports=['pkg_resources'],
             hookspath=None,
             runtime_hooks=None)

pyz = PYZ(a.pure)

if onefile:
    exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas, name=app_name,
        debug=False, strip=None, upx=True, console=console, icon='src/app.ico', version='src/app.ver')
else:
    exe = EXE(pyz, a.scripts, exclude_binaries=True, name=app_name, debug=False,
        strip=None, upx=True, console=console, icon='src/app.ico', version='src/app.ver')
    coll = COLLECT(exe, a.binaries, static_files, a.zipfiles, a.datas, strip=None, upx=True, name='app')

最终,我找到了与此问题相关的核心问题: