Questions tagged [pyinstaller]

PyInstaller is a multi-platform tool designed to convert Python (.py) files into stand-alone executable files on Windows, Linux, macOS, Solaris, and AIX.

PyInstaller is a multi-platform tool designed to convert Python (.py) files into standalone executable files on Windows, macOS, Linux, FreeBSD, Solaris, and AIX. These executable files can run on a system without Python installed, but are OS-dependent, meaning that the executable has to be generated from a machine with the same operating system than the machine in which it will run (for instance, it is not possible to generate an executable from macOS and then run it on Windows).

It is designed to be compatible with many third-party modules such as PyQt, Django or matplotlib without requiring configuration or plugins.

PyInstaller is open source software, distributed under the GPL. It works out of the box with any Python version 2.7 / 3.5-3.7.

The latest version of Pyinstaller is available on GitHub http://www.pyinstaller.org/

Usage

Install PyInstaller from PyPI:

pip install pyinstaller

Go to your program’s directory and run:

pyinstaller yourprogram.py

This will generate the bundle in a subdirectory called dist.

6448 questions
174
votes
15 answers

Bundling data files with PyInstaller (--onefile)

I'm trying to build a one-file EXE with PyInstaller which is to include an image and an icon. I cannot for the life of me get it to work with --onefile. If I do --onedir it works all works very well. When I use --onefile, it can't find the…
Arboreal Shark
  • 2,221
  • 3
  • 17
  • 12
117
votes
9 answers

Determining application path in a Python EXE generated by pyInstaller

I have an application that resides in a single .py file. I've been able to get pyInstaller to bundle it successfully into an EXE for Windows. The problem is, the application requires a .cfg file that always sits directly beside the application in…
Soviut
  • 88,194
  • 49
  • 192
  • 260
92
votes
7 answers

App created with PyInstaller has a slow startup

I have an application written in Python and 'compiled' with PyInstaller. It also uses PyQt for the GUI framework. Running this application has a delay of about 10 seconds before the main window loads and is shown. As far as I can tell, this is not…
EB.
  • 3,383
  • 5
  • 31
  • 43
75
votes
5 answers

Reducing size of pyinstaller exe

I have a simple pandas pyinstaller exe which is over 40MB. My exe example: import collections import csv import selenium import pandas print('hi') 40MB+ for this seems a bit overkill. How can I reduce this as much as possible? One…
user9062171
75
votes
11 answers

Pyinstaller setting icons don't change

When I use the command: pyinstaller.exe --icon=test.ico -F --noconsole test.py All icons do not change to test.ico. Some icons remain as the pyinstaller's default icon. Why? All icon change in windows 7 32bit windows 7 64bit (make an exe file…
Somputer
  • 1,223
  • 2
  • 11
  • 20
69
votes
3 answers

Get all modules/packages used by a python project

I have a python GUI application. And now I need to know what all libraries the application links to. So that I can check the license compatibility of all the libraries. I have tried using strace, but strace seems to report all the packages even if…
user2109788
  • 1,266
  • 2
  • 12
  • 29
67
votes
11 answers

Program made with PyInstaller now seen as a Trojan Horse by AVG

About a month ago, I used PyInstaller and Inno Setup to produce an installer for my Python 3 script. My AVG Business Edition AntiVirus just started complaining with today's update that the program has an SCGeneric Trojan Horse in the main .exe file…
Jeff H
  • 915
  • 1
  • 6
  • 11
64
votes
6 answers

Getting rid of console output when freezing Python programs using Pyinstaller

I have recently written a fairly simple program for my grandfather using Python with GUI from Tkinter, and it works beautifully for what he will be using it for. However, there is, of course, the ugly console output window. I have successfully…
dfreeze
  • 655
  • 1
  • 5
  • 6
62
votes
10 answers

Windows- Pyinstaller Error "failed to execute script " When App Clicked

I am having a tough time overcoming this error, I have searched everywhere for that error message and nothing seems relevant to my situation: "failed to execute script new-app" new-app is my python GUI program. When I run pyinstaller using this…
aBiologist
  • 2,007
  • 2
  • 14
  • 21
56
votes
3 answers

docker compose: Error while loading shared libraries: libz.so.1: failed to map segment from shared object: Operation not permitted

After installing docker and docker-compose on: NAME="Red Hat Enterprise Linux Server" VERSION="7.6 (Maipo)" When executing: sudo docker-compose -version It returns: Error while loading shared libraries: libz.so.1: failed to map segment from…
Roberto Gonçalves
  • 3,186
  • 4
  • 13
  • 27
54
votes
5 answers

Pyinstaller adding data files

I'm struggling with pyinstaller. Whenever I build this specific script with a kivy GUI and a .kv file, and run the .exe after the build, I get a fatal error: IOError: [Errno 2] No such file or directory: 'main.kv' I've tried adding the .kv file, as…
staos2
  • 645
  • 1
  • 5
  • 7
54
votes
5 answers

How can I use pywin32 with a virtualenv without having to include the host environment's site-packages folder?

I'm working with PyInstaller under Python 2.6, which is only partially supported due to the mess MS have created with their manifest nonense which now affects Python since it is now MSVC8 compiled. The problem is that the manifest embedding support…
jkp
  • 78,960
  • 28
  • 103
  • 104
49
votes
6 answers

What does a "version file" look like?

I've been googling this for ages now without results. The PyInstaller manual says: --version-file=FILE add a version resource from FILE to the exe That sounds nice. I want to put version information in my executables. The problem is that I…
Hubro
  • 56,214
  • 69
  • 228
  • 381
49
votes
5 answers

Including a directory using PyInstaller

All of the documentation for PyInstaller talks about including individual files. Is it possible to include a directory, or should I write a function to create the include array by traversing my include directory?
Simon Knight
  • 600
  • 1
  • 6
  • 12
47
votes
13 answers

No module named when using PyInstaller

I try to compile a Python project under Windows 7 using PyInstaller. The project works fine, there are no issues, however when I try to compile it the result doesn't work. Though I get no warnings during compilation there are many in the…
a_guest
  • 34,165
  • 12
  • 64
  • 118
1
2 3
99 100