【问题标题】:Run Python binaries under Windows XP在 Windows XP 下运行 Python 二进制文件
【发布时间】:2015-09-12 00:03:25
【问题描述】:

我将我的 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')

【问题讨论】:

  • A) 你真的不应该使用 XP。 MS 不再支持它,使用它非常危险。 B) 你不能用支持 XP 的旧版本重新编译吗?
  • 我发现当我在 PyCharm 下运行时,在 WinXP 下也一切正常

标签: python windows python-2.7 pyside pyinstaller


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2012-05-17
    • 1970-01-01
    • 2012-04-23
    • 2010-10-18
    • 2016-02-07
    • 1970-01-01
    • 2010-12-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多