我是 Linux 的新手,我目前使用PYQT4-python3.4 在 cx_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/