如何使在 UBUNTU 上使用 cx_Freeze 构建的 PYQT4 应用程序在 Linux SUSE 上运行。

how to make PYQT4 app built with cx_Freeze on UBUNTU work on Linux SUSE.

我对 Linux 有点陌生,我目前使用 PYQT4-python3.4 制作了一个应用程序Ubuntu 上使用 cx_Freeze。它在 Ubuntu 上工作正常,但是,当我试图在 linux SUSE 上打开应用程序时,它没有工作。

我得到的错误是

"Could not display AppName"

There is no application installed for "executable" files.

Do you want to search for an application to open this file?

我猜我需要为我想要 运行 应用程序的每个 linux 发行版制作一个新版本?还是有更好的方法让我的程序仅使用一个构建就可移植到所有 linux 环境?

注意:这是我的 setup.py,我 运行 cx_freeze(如果需要修改,请告诉我!:D)

import sys,platform
from cx_Freeze import setup, Executable

def getTargetName():
    myOS = platform.system()
    if myOS == 'Linux':
        return "AppName"
    elif myOS == 'Windows':
        return "AppName.exe"
    else:   
        return "AppName.dmg"


base = None
if sys.platform == "win32":
    base = "Win32GUI"
 
exe = Executable(script = "main.py", base=base, targetName = getTargetName())

build_exe_options = {"packages": ["re", "sip"],
                     "includes":["modules"],
                     "icon":"icon.ico"}

setup(  name = "setup",
        version = "1.0",
        description = "GUI Application!",
        options = {"build_exe": build_exe_options},
        executables = [exe])

提前致谢!

事实证明,我所缺少的只是做一个

chmod +x AppName

然后我 运行 它在终端中运行,效果非常好。 另外,我可以双击该应用程序,它也 运行!