Select Page

Making Use Of Py Installer. Running PyInstaller from Python rule

Supporting Multiple PlatformsР’В¶

In your normal development setup if you distribute your application for only one combination of OS and Python, just install PyInstaller like any other package and use it.

Supporting Several Python EnvironmentsР’В¶

We recommend you use venv when you need to bundle your application within one OS but for different versions of Python and support libraries – for example, a Python 3.6 version and a Python 3.7 version; or a supported version that uses Qt4 and a development version that uses Qt5 вЂ. With venv you are able to keep various combinations of Python and installed packages, and switch in one combination to a different effortlessly. These are called environments that are virtual venvs in a nutshell.

  • Use venv to create as much development that is different since you need, each having its unique mix of Python and installed packages.
  • Install PyInstaller in each digital environment.
  • Utilize PyInstaller to create the application in each environment that is virtual.

Keep in mind that whenever utilizing venv , the trail towards the PyInstaller commands is:

  • Windows: ENV_ROOT\Scripts
  • Other people: ENV_ROOT/bin

Under Windows, the pip-Win package makes it particularly very easy to put up different surroundings and switch among them. Under GNU/Linux and Mac OS, you switch surroundings at the demand line.

See PEP 405 in addition to Python that is official Tutorial Virtual Environments and Packages to learn more about Python digital surroundings.

Supporting Several Systems

If you need to circulate the application for longer than one OS, for instance both Windows and Mac OS X, you need to install PyInstaller for each platform and bundle your software separately for each.

This can be done from just one device utilizing virtualization. The free virtualBox or the compensated VMWare and Parallels permit you to run another complete operating-system being a “guest”. You put up a digital device for each “guest” OS. The support packages your application needs, and PyInstaller in it you install Python.

A File Sync & Share system like NextCloud pays to with digital devices. Install the synchronization customer in each machine that is virtual all connected to your synchronization account. Keep an individual content of one’s script(s) in a synchronized folder. Then on any machine that is virtual can run PyInstaller hence:

PyInstaller reads scripts through the typical synchronized folder, but writes its work files while the bundled application in files which can be regional towards the machine that is virtual.

On the other platform, as by default it uses a subdirectory of your home directory as its cache location if you share the same home directory on multiple platforms, for example GNU/Linux and OS X, you will need to set http://www.1hrtitleloans.com/payday-loans-wy/ the PYINSTALLER_CONFIG_DIR environment variable to different values on each platform otherwise PyInstaller may cache files for one platform and use them.

It is stated to be feasible to cross-develop for Windows under GNU/Linux making use of the wine environment that is free. Further details are required, observe how to Contribute.

Shooting Windows Version Information

A Windows software may demand a variation resource file. A variation resource contains a team of information structures, some containing integers that are binary some containing strings, that describe the properties associated with executable. For details look at Microsoft variation Ideas Structures web web page.

Variation resources are complex plus some elements are optional, others needed. Once you see the variation tab of the characteristics dialog, thereРІР‚в„ўs no easy relationship between the information shown therefore the framework for the resource. With this explanation PyInstaller includes the pyi-grab_version demand. It really is invoked using the path that is full of every Windows executable which have a variation resource:

The demand writes text that represents a variation resource in readable type to output that is standard. You are able to duplicate it through the system screen or redirect it to a file. You’ll be able to modify the variation information to adjust it to your program. Making use of pyi-grab_version you’ll find an executable that shows the type or type of information you desire, copy its resource information, and alter it to match your package.

The variation text file is encoded UTF-8 and can even include non-ASCII figures. (Unicode characters are permitted in variation resource sequence fields.) Make sure to modify and conserve the writing file in UTF-8 unless you’re specific it includes just ASCII sequence values.

Your edited version text file could be provided utilizing the –version-file= solution to pyi-makespec or pyinstaller . The written text information is changed into A variation resource and installed in the bundled application.

In a Version resource there are 2 64-bit values that are binary FileVersion and ProductVersion . These are given as four-element tuples, for example in the version text file

The sun and rain of each tuple represent 16-bit values from most-significant to least-significant. As an example the value (2, 0, 4, 0) resolves to 0002000000040000 in hex.