Convert GUI App to Real Program - Python to exe to setup wizard

501,943
0
Published 2023-01-27
You've just made a beautiful GUI app with Python - but there's a big difference between creating an app for your personal use and distributing it all across the web, reaching many people who don't necessarily know anything about Python.
In this tutorial, I will show you exactly how to convert your Tkinter, Kivy, KivyMD, PyQT5, or other GUIs into a full-blown professional program! 🤩🤩🤩
The end result is a 😱 SINGLE SETUP FILE 😱 which anyone can download and install on their computer - even your grandmom!!! 👵
We will use Pyinstaller to create an executable file and Inno Setup to bundle it with dependencies and convert them into a setup wizard.
In addition, we will discuss some common errors, how to fix them and how to avoid irrelevant instructions (hint: do we really need to modify the SPEC file? 🤔)
We will briefly tackle licensing (open source, as you may guess 😉), and generating icons.
Please note, this video is designed for Windows developers and users! However, I will cover Linux and Mac as well in some future tutorials... the Mac tutorial is of course inspired by Tom! XDD (but only members of our Discord community will understand the joke, this is how I test if they read video descriptions 😅)

-------------------------------------------
⏰ Time Stamps ⏰
-------------------------------------------
00:00 - intro
00:40 - project files and database
01:31 - download Random Recipe Picker (or use your own Python app)
03:29 - install requirements.txt
03:46 - Pyinstaller vs auto-py-to-exe
04:25 - run Pytinstaller builder
05:22 - prep GUI script for Pyinstaller
05:56 - resource path (and important sys._MEIPASS fix!)
08:18 - SPEC file
09:20 - generate software icons
10:04 - convert script and assets to exe file
11:22 - fix Pyinstaller File Not Found Error
12:48 - test executable
13:36 - install Inno Setup
14:17 - convert exe and assets into a setup file
16:39 - license
20:00 - add subdirectories to Inno Setup compilable
21:56 - test setup file on another PC
22:57 - thanks for watching! :)

-------------------------------------------
📽️ Important Tutorials 📽️
-------------------------------------------
⭐ Create GUI App with SQLite and Tkinter (Random Recipe Picker):
   • Create GUI App with Tkinter and SQLit...  
⭐ Anaconda for Beginners:
   • Anaconda Beginners Guide for Linux an...  
⭐ Convert .py to .exe with auto-py-to-exe:
   • Convert py to exe - from code to soft...  

-------------------------------------------
💻 VENV Alternative 💻
-------------------------------------------
$ python3 -m venv name_of_my_env
$ source name_of_my_env/bin/activate

-------------------------------------------
🖇️ Tutorial Links 🖇️
-------------------------------------------
🔗 Random Recipe Picker Repository: github.com/MariyaSha/RandomRecipePicker
🔗 Resource Path Function (Stack Overflow): stackoverflow.com/questions/31836104/pyinstaller-a…
🔗 PNG to ICO Icon Converter: image.online-convert.com/convert-to-ico
🔗 Inno Setup: jrsoftware.org/isinfo.php
🔗 Open Source Initiative MIT License: opensource.org/licenses/MIT

-------------------------------------------
🤝 Connect with me 🤝
-------------------------------------------
🔗 Github:
github.com/mariyasha
🔗 Discord:
discord.com/invite/wgTTmsWmXA
🔗 LinkedIn:
ca.linkedin.com/in/mariyasha888
🔗 Twitter:
twitter.com/mariyasha888
🔗 Blog:
www.pythonsimplified.org/

-------------------------------------------
💳 Credits 💳
-------------------------------------------
⭐ Beautiful titles, transitions, sound FX, and music:
mixkit.co
⭐ Beautiful icons:
flaticon.com

#gui #graphics #app #application #python #pythonprogramming #exe #pythoncoding #software #softwaredevelopment #pythonsimplified #convert #code #pyinstaller #innosetup #wizard #windows

All Comments (21)
  • @hiutale
    Hih, this is a tad too advanced info for me but oh my gosh how much I CANNOT WAIT to use this tutorial in real life!!! 😍 Thank you, Mariya! 😍 I'm only half way through but I'll finish watching the tutorial now just to see how much I understand already. Comparing oneself to the past versions of oneself is the best way too see the progress! Keep it up everyone!! 😁😁👍 And Mariya, please keep up the amazing work! Our support for you is an infinite loop after clicking 'run'! 👾🎵🥳
  • @talosong7409
    I rarely comment on youtube videos, but I gotta mention just how much time I saved from the MEIPASS fix from your video. Absolute lifesaver.
  • Okay , thank you for this turotial. Yout really did a wonderfull job, and the part where you fix one-by-one the problems is actually the best so that new guys (like me) learn to follow a process of fixing!!!!
  • @mattknezel8003
    This was the most complete video on this topic I have found. Appreciate the great structure and clear instruction!
  • @mary_040
    Hi Marija, I just recently discovered your channel. I often have problems evaluating and understanding documentations and plain text for myself, so I love that you visualize a lot in your videos! The simplicity of the examples is incredibly important to understand the principle of things. With this knowledge, it is then easier to understand complex explanations afterwards. You have a gift for teaching and illustrating! Besides that, it makes me very happy to see other women succeed in the IT world. - A fellow Maria :)
  • @ojaimark
    I can't thank you enough for this video. Like lots of python developers I've been tearing my hair out trying to find a simple way to deploy python scripts in a way that my non pythonic coworkers can utilize them. This works so well, and it's a very familiar workflow for them to just install it like any other program. Also thank god you mentioned MEIPASS2 or I might have given up before finding the answer to that error.
  • Thank you so much for such a clear ,step-by-step and descriptive video, not only you gave steps to follow but also gave us an approach to handle different errors...very grateful for such a wonderful explanation
  • @pr00009
    Milady ill slay the entire planet for you. bowing down to your extreme knowledge and experience
  • @davidkirk831
    After Struggling to understand how to package my application this tutorial really helped me. Some of my steps were a bit different as I didn't need to set up my assets folder but.. the step of ensuring you add the folder to this step DestDir: "{app}/ was crucial. Thank you!
  • @jenglish1986
    Awesome video. Like code you are so concise. No distractions and you cover a lot of ground. Having watched hundreds of programming videos I must say this was the best I’ve seen. Please keep making projects!
  • I have never seen a tutorial that is so detailed and even inclusive of so many different scenarios that makes me save hours worth of time researching to debug on my own. tysm!!!
  • @ellukayou
    Thank you so much, I am developing a warehouse app and didn't find a tutorial for people like me. Thank you!
  • @emanretsiger9343
    Today I found your channel, watched the video and I liked you - I subbed, and commented (which I do rarely). I am a beginner Python learner but you make a complicated task look simple to understand and very enjoyable. Indeed! Python Simplified. Thanks, Maria for your efforts and that is much appreciated.
  • Found a great channel where the presenter shows each step in details. Subbed, liked and commented.
  • @venjas5451
    Hey, awesome video!! This is the first explanation and way that worked for my self-made program. A few things I needed to adapt was the requirements.txt file, which can be done when you are in the converter environment inside your folder where your .py program is and then you have to type in "pip freeze > requirements.txt". This creates the requirements.txt file needed for your own program. Additionally, if you want so save things into your program files without the user to search for a folder itself for example if you use "plt.savefig("figurename.png")" then you also have to use the resource_path() function such that you use "plt.savefig(resource_path("figurename.png"))". Hope this hepls for other that also struggled.
  • This is perfect! I have some python programs I've been wanting to distribute and now I have the way to do it. Thank you for your excellent tutorials, you are such an awesome teacher. :)
  • I have been following your tutorials for a very long time. All are very helpful and really python simplified. Thank you and good luck.
  • @reshmah1497
    Thank you very much. Been searching everywhere for a proper way to package to exe file with installer. Found your useful video.
  • @spencer3752
    Thank you so much for this video. I've used pyinstaller for quite some time, but now I know how to make a setup file, which is quite a bit more professional! Now the only thing I need to figure out is how to add a digital signature to the program :) At 16:25 -- what you're being asked is if you want to associate file extensions with your program. For example, you might have `.txt` files "associated" with the program Sublime Text so that Sublime Text is used to open files with that extension by default (or is available in the "open with" context menu when right-clicking text files) So, maybe users of your program want to save recipes to a file. Maybe your program can save them to files with a custom extension like `.recipe` -- then when users click on their `.recipe` files, your application will be launched with the file path provided as an argument.
  • @thecker9
    Holy cow this was super helpful and well explained. Thank you so much!