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

标签 linux ubuntu python-3.x cx-freeze suse

我是 Linux 的新手,我目前使用PYQT4-python3.4cx_Freeze 上制作了一个应用程序 < strong>Ubuntu。它在 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 环境?

注意:这是我为 cx_freeze 运行的 setup.py(如果需要修改,请告诉我!: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

然后我在终端中运行它,它运行得非常棒。 此外,我能够双击该应用程序,它也运行了!

关于linux - 如何使在 UBUNTU 上使用 cx_Freeze 构建的 PYQT4 应用程序在 Linux SUSE 上运行。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31689166/

相关文章:

python - 在 Google VM (Ubuntu) 上安装 TA-lib

python - Python中的抽象方法

perl - 尝试在 Apache 2.4.6 Ubuntu 13.10 上运行 perl cgi 文件时出现 500 内部服务器错误

linux - 如何将我的旧站点从共享主机服务器移动到 VPS?

c - 如何修复终端中的段错误?

linux - 如何从 Linux 命令行彻底关闭 Eclipse?

ruby - LookController#at 中的参数错误

python - 如何从类外部向类方法添加属性?

python - 递归循环时的组列表

android - top vs/proc/pid/stat 哪个更适合cpu%使用率计算