Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Creating onfile exe for Python + QML based deployment on Desktop

Creating onfile exe for Python + QML based deployment on Desktop

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 786 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sudhir F
    wrote on 20 Jun 2022, 09:19 last edited by
    #1

    Hi,

    I have created a desktop application with python and qml.
    Now want to create a single exe from this.
    Please let me know how it can be done.

    SF

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 20 Jun 2022, 19:54 last edited by
      #2

      Hi and welcome to devnet,

      If memory serves well, nuitka has support for Qt.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • N Offline
        N Offline
        ndias
        wrote on 21 Jun 2022, 09:37 last edited by
        #3

        Hi @Sudhir-F,

        As @SGaist metioned before, you can use Nuitka to build and create an executable from Python code.

        Nuitka can be installed using PIP Installer:

        python -m pip install nuitka
        

        Build our program with --onefile command option to generate a single executable file. Use --standalone command option to generate a whole program.dist folder
        Depending on the Python bindings you are using you should add one of the following command options:

        --plugin-enable=pyqt5
        --plugin-enable=pyqt6
        --plugin-enable=pyside2
        --plugin-enable=pyside6
        

        Nuitka plugin list can be viewed using python -m nuitka --plugin-list command.

        Bellow you can find comand example including compilation of a resources folder:

        python -m nuitka --plugin-enable=pyside6 --follow-imports --windows-disable-console --windows-icon-from-ico="resources/myIcon.ico" --include-data-dir=./resources=resources --onefile "myProgram.py"
        

        As an alternative to Nuitka you can also use PyInstaller or others.

        Regards

        1 Reply Last reply
        1

        1/3

        20 Jun 2022, 09:19

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved