Search code examples
linuxubuntupython-3.xcx-freezesuse

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


I am a little new to Linux, and I've currently made an app using PYQT4-python3.4 using cx_Freeze on Ubuntu. It worked okay on Ubuntu, however, when i was trying to open the app on linux SUSE , it did not work.

the error i get is

"Could not display AppName"

There is no application installed for "executable" files.

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

I'm guessing that I need to make a new build for each linux distribution I want to run the app? or is there a better way to make my program portable for all linux environments using only one build?

Note: here is my setup.py that i run for cx_freeze(if at all this needs to be modified please let me know! :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])

Thanks in advance!


Solution

  • As it turns out, all i was missing was to do a

    chmod +x AppName
    

    Then i ran it in terminal and it worked like a charm. Also, i was able to double click the app and it ran too!