How to package PySide2 applications for distribution? - python-3.x

I has used CXFreeze in past to package python applications but in most cases the installer packages build thru CXFreeze failed to install when I distributed it to other users.
Is there a better way to create distributable for Pyside2 applications?

Try pyinstaller. I also do PySide2 projects and this installer works fine for me at least for windows applications. See https://pythonhosted.org/PyInstaller/.

Related

How to run an Electron .exe app on Linux?

I'm trying to run an application build with Electron on Linux. They app maker offers an .exe installation file. So I figured I'd install it in WINE, but I seem to be missing something the app needs to run.
Since the install is an .exe, do I need WINE? And if I need WINE, what do I need to install to make the app work? I have tried two Electron apps, both only downloadable as a .exe install file.
Electron adds os native calls, so .exe files usually do not work. WINE is not able to emulate all of those calls, so if it isn't working for you, then you are out of luck I guess. Look for apps that offer linux versions, like https://www.electronjs.org/apps/camunda-modeler. If you have access to the repository, chances are they build it using electron-builder. You can just build it yourself with the command electron-builder build --linux in most cases

Compile python 3 script to standalone exe in Linux

Can a python 3 script be compiled in a linux environment in such a way as it can be run under Windows?
If so what compile tool? ie. py2exe or pyinstaller ect.
You're looking for cross-compilation, and the answer is no.
Can I package Windows binaries while running under Linux?
No, this is not supported. Please use Wine for this, PyInstaller runs fine in Wine. You may also want to have a look at this thread in the mailinglist. In version 1.4 we had build in some support for this, but it showed to work only half. It would require some Windows system on another partition and would only work for pure Python programs. As soon as you want a decent GUI (gtk, qt, wx), you would need to install Windows libraries anyhow. So it's much easier to just use Wine.
Can I package Windows binaries while running under OS X?
No, this is not supported. Please try Wine for this.
Can I package OS X binaries while running under Linux?
This is currently not possible at all. Sorry! If you want to help out, you are very welcome.
You may use Wine or the Windows Subsystem for Linux to attempt using PyInstaller to build stand-alone binaries for different operating systems, however, neither PyInstaller, nor Py2Exe, nor cx_freeze, nor any tool to my knowledge does this.
Effectively, in-order to do something like this, you would need a cross-compiler such as MinGW or VC++ for Linux, and integrate it into PyInstaller, which is very far outside of the scope of the project. It is much easier to use WINE or having a dual-boot system or multiple development computers.

How do I launch doxygen/perl from Monodevelop on linux/flatpak?

I have a mono-based project that is developed on Linux. Is there some trick to getting custom build steps to run in Monodevelop 7 packaged in flatpak?
The custom build steps that build the doxygen documentation and package it up do not launch. Doxygen and perl are both installed in /usr/bin, and the build steps work properly outside with the legacy monodevelop 5. Doxygen is "not found" and perl runs but is using an (apparently) flatpak builtin /usr/bin/perl that does not have any of the required CPAN modules.
How do I get custom build steps to run in monodevlop 7?
You don't. Flatpak will not run programs that are masked by its packaging, so for example you can not run python or perl scripts that require modules that are not part of the monodevelop flatpak package.
The best solution I can come up with is to launch everything from an external non-cross-platform Makefile, using msbuild for the C# compilation steps. The build does not have to be cross platform, as long as the end product is, so this is a workable, if lame, solution. At least this way you can run the program and debug unit tests in the monodevelop IDE.

What kind of libraries should my program install as system libraries?

I am building an audio processing application in Qt and an installer through Inno Setup. Recently, a co-worker testing the application had difficulty running it because "VCOMP100.DLL" was missing. We had been through a few versions already and had not gotten the error, but I will include it in the installer anyways. However, my version of vcomp100.dll was in my system files - did that mean I should install it there? And so I wondered:
What kinds of libraries should my installer try to install in the system directory? On one hand, duplicated data is wasted data, but on the other hand, I'm nervous about messing with system files. I have ~5 types of libraries:
Very basic C/C++ runtime libraries (msvcp100, msvcr100)
Unicode support libraries (icudt51, icuin51, icuuc51)
OpenGL as part of Qt (libEGL, libGLESv2)
Qt-specific libraries (Qt5Core, Qt5Gui, Qt5Widgets)
Sound processing libraries (soxr, libsndfile, portaudio)
Can you explain what to install where, but more importantly, why?
Do not install these files directly.
Use bundled installers from companies which produce that libraries.
For example instead of copying msvcp100, msvcr100 use Microsoft Visual C++ 2010 Redistributable Package (x86 or 64bit: http://www.microsoft.com/en-us/download/details.aspx?id=5555) to install VC++ runtime files.
There may be another dependencies in your libraries and this package install everything required.
The installers can be run silently and it is more user friendly. If the runtime is already installed there is no problem if it is overwritten.
Check these topics for more info:
How to make vcredist_x86 reinstall only if not yet installed?
InnoSetup - Check if visual studio 2010 crt redist is installed, if not then run installer
I suppose this should be the same for Qt.

What is the best approach to distribute a project in both windows and linux?

So there is this particular jython project that needs a couple of dependencies, such as Jenkins, some kind of subversion, and this needs to be done on windows.
Would it be sane of me to consider using pip to help install all of these items, or should I look elsewhere, such as NSIS?
Update:
I really should've rephrase this - my fault for asking the question late at night.
There's an automated testing project that has the following dependencies:
Java JDK
Jython
Ant
Robot Framework
subversion
Jenkins
I personally prefer to run on Linux, but people that need to use this are typically Windows users. I'm confident enough to write a script to install all of this on Linux, but what I want is to have a script / installer that would install the relevent tools.
I would prefer to have a single script to do all of this - it's easy on Ubuntu with apt-get; but on windows, this quickly becomes non-trivial.
What is the best way to try and do this? Should I create separate installers for separate OS
pip is the acronym for pip install packages, python packages, and it only install Python packages.
Since Jenkins and Subversion are not Python packages, as far as I know, you can't install them, and it is not "sane".
Unfortunately there is no single established tool to install everything in every platform.
Use pip to install all your python packages, and prefer to use virtualenv to create isolated Python environments to manage your projects.
Since pip only installs python packages and Jenkins isn't a python package (it's written in Java), you cannot use it to install those packages.
You should totally take a look to virtualenv, but if you need to do a "double click" installer for your project in Windows i think that NSIS is the way to go.
I am successfully using install4j to create an executable installer for Windows, Linux and OSX. The application is Java and it bundles JRE. Install4j creates installer for each specified platform using respective JRE. So far it worked great on Windows and it somewhat works on Linux and OSX (e.g. in new version of install4j, JRE for Java 1.8 is not bundled properly for linu, so the JRE is preinstalled, but it could be automated). It also allows you to run non-interactive installer.

Resources