Python Application Executable - python

How we can create an Installable Package of Large Python Project ? Is it advisable to convert the application as .EXE and install on Linux or Windows OS ? For example the .NET C# applications are being packaged as .MSI (Installable). In the same way how the Python Application can be deployed ?

You can create exe first and then create setup file with inno setup.
https://jrsoftware.org/isinfo.php
you can find download links and usage from this site
you can use pyinstaller for exe

Related

How to package Python GUI application into Debian package to run on debian based operating system or any other linux systems?

I have an python GUI application that communicates with a web application, the website generates a link to open the desktop application (python app), so i have bash scripts that modify the system variables to make it ready for the system to recognize the link and open the app,
My question is that i want to make a debian package for that app with the files and bash scripts, how to do it??
I tried to convert the python application into one-file using pyinstaller and put bash scripts in same installer folder then run them using another python application that i compiled also with pyinstaller but the error happened telling that pythonlib3.8 not found on the system (Ubuntu 18) and my app developed on Ubuntu 20.
I would suggest using fpm. This is a tool specifically for creating packages for different Linux distributions such as Debian or RHEL.
Here is the documentation and even specific example for python.

Python files to an MSI Windows installer

So I can use PyInstaller to make a one-file executable and to make a standard executable among other files in a folder.
But how do I turn Python files into an MSI installer so that it's fool-proof where it makes a shortcut on the desktop? (For distribution so that it isn't required for the user to have Python installed)
(When I say Python files to an MSI installer I mean the regular PyInstaller to folder output but with a way of getting a shortcut to the executable onto the desktop very easily for a regular user)
(It doesn't have to be PyInstaller if there's an alternative).
Pyinstaller does not intergrate such a tool.
You could get a third party installer (some suggested here How to create a robust, minimal installer for Windows?) and add your output exe to it and install that way, if you choose the right tool you will be able to add to desktop (plus a lot of other actions such as adding to path ect).
Or you could use cx_Freeze which has it built in. When running the setup script just add the bdist_msi flag.
It can add to shortcut desktop but is fairly limited in other ways (or you may need to perform some hack).
To add to desktop with cx_Freeze see Use cx-freeze to create an msi that adds a shortcut to the desktop.
You can use Inno which creates a shortcut on the desktop and start menu. Also, it is located in the program directory of windows. it means that you can install/uninstall it like other programs or applications.
Inno website:
https://www.jrsoftware.org/isinfo.php
A tutorial on how to use it on youtube:
https://www.youtube.com/watch?v=DTQ-atboQiI

Creating an executable from a Pycharm Python Project

How can I take all scripts and files in my Python project directory and create a single executable. I have tried using this: How do I create an executable file out of a PyCharm project using PyInstaller? but it does not work. I have developed the project in PyCharm and I am using Python 3.4.
You can use cx_Freeze it's the same way that py2exe and py2app. It supports python 2.7 or highter or you can use Pyinstaller that binds in an executable all the stuff.
You can download it using the following command:
pip install pyinstaller
Or you can download it from the website

What is the easy way to package my python program as desktop application?

How could I turn my python program to a windows application?
As python is a scripting language how we make its programs for desktop applications
One easy way is to use PyInstaller.
pip install pyinstaller
Go to your program’s directory and run:
pyinstaller yourprogram.py
This will generate the bundle in a subdirectory called dist.

Can I create .exe file from python project If I am working on mac?

I am working on Mac iOS, but I need to make my whole project as .exe file, not .dmg. It is meant to be running on Windows, I would like to use pyinstaller but I faced some problems, wondering if working on Mac has to be the reason.
PyInstaller has can only target the OS it is running on: Source. However, you could use a VM running Windows to build a Windows executable, or use something like wine (Example here) to package it without a VM.

Categories