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
24
votes
3 answers

What is sys._MEIPASS in Python

What is sys._MEIPASS. What is the value of this variable and it's use ? I was a looking one python script but when I ran it on eclipse(pydev). It showing error.
Kumar Roshan Mehta
  • 3,078
  • 2
  • 27
  • 50
24
votes
1 answer

PyPy and PyInstaller

Is it possible to build a single-binary or single-directory package with PyInstaller that uses pypy as interpreter? Any special tricks to do that? Some alternative to PyInstaller? If not, what are the fundamental technical reasons? Notes why/how…
Dima Tisnek
  • 11,241
  • 4
  • 68
  • 120
24
votes
3 answers

Pyinstaller: generate -exe file + folder (in --onefile mode)

Now i'm working with Pyinstaller. I have an script which get images from a img folder.. /python |----/img |----|----icon1.ico |----|----icon2.ico |----maint.py My script to generate .exe is pyinstaller.py --windowed --noconsole --clean --onefile…
MigRome
  • 1,095
  • 1
  • 12
  • 28
23
votes
5 answers

Python: Excluding Modules Pyinstaller

I've begun using Pyinstaller over Py2Exe. However I've rather quickly run into a problem. How do I exclude modules that I don't want, and how do I view the ones that are getting included into the single executable file? I can remove some pyd and dll…
Morphine
  • 643
  • 2
  • 6
  • 11
23
votes
8 answers

Error when using pyinstaller: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff

I have an issue when i compile a PyQt code with pyinstaller. I use this line to compile: c:\Anaconda3\Scripts\pyinstaller.exe -y -F --distpath="." MyQt.py then I get this error message: File…
ymmx
  • 4,769
  • 5
  • 32
  • 64
23
votes
9 answers

Installing pyinstaller via pip leads to "failed to create process"

Does anyone know why pyinstaller immediately fails after installed via pip via anaconda 32bit? I installed pyinstaller via pip install pyinstaller through the anaconda command prompt on Windows 64 bit using 32 bit anaconda (because I want to create…
phillipsK
  • 1,466
  • 5
  • 29
  • 43
22
votes
3 answers

How to include only needed modules in pyinstaller?

I'm using pyinstaller to generate an .exe file for my single python file, but the size is more than 30MB and the startup is very slow. From what I have gathered is that pyinstaller by default bundles a lot of stuff that are not needed. Is there a…
user9128740
22
votes
2 answers

How to input arguments after compiling python program with PyInstaller

After import sys, I use sys.argv to get input arguments. But after I compile my program with PyInstaller, the exe program will not accept my input. Instead, it uses the default value I set for the program. If I run it with python this_script.py it…
ohmygoddess
  • 619
  • 1
  • 7
  • 23
22
votes
3 answers

How to install PyInstaller?

(I'm on Windows.) I want to use PyInstaller. I could always create bin files with pyinstaller.py [args]. It's not a package with an __init__.py file, it has no setup.py and it doesn't work to create a folder, put it in my PYTHONPATH, put…
rynd
  • 1,865
  • 5
  • 22
  • 24
21
votes
2 answers

Python: how to specify output folders in Pyinstaller .spec file

I am using python 3.5 and pyinstaller version 3.1.1. I have specified a .spec file, called SCADAsync_spec.spec, as follows: block_cipher = None a = Analysis(['SCADAsync.py'], …
Nickj
  • 982
  • 3
  • 8
  • 17
21
votes
3 answers

How can I make PyInstaller's .spec files actually portable? (woes absolute path for 'pathex' parameter)

The PyInstaller .spec file is mean to be portable across the three platforms that it supports: Windows, Mac OS X and Linux. I find it much easier to generate the .spec file once and modify it at will before building an executable from it. In every…
fatuhoku
  • 4,815
  • 3
  • 30
  • 70
21
votes
2 answers

Building executables for Python 3 and PyQt

I built a rather simple application in Python 3.1 using PyQt4. Being done, I want the application to be distributed to computers without either of those installed. I almost exclusively care about Windows platforms, so my goal is to have a single…
21
votes
1 answer

PyInstaller 2.0 bundle file as --onefile

I'm trying to bundle my py script as an .exe using PyInstaller 2.0. I am able to bundle the script, but in my script, I need to open a file that should be bundled in the exe (so it's portable). I'm having trouble doing this.. In my .py, I have…
user1914730
  • 491
  • 1
  • 4
  • 7
20
votes
5 answers

IndexError: tuple index out of range when I try to create an executable from a python script using auto-py-to-exe

I have been trying out an open-sourced personal AI assistant script. The script works fine but I want to create an executable so that I can gift the executable to one of my friends. However, when I try to create the executable using the…
DevLearner
  • 369
  • 3
  • 11
20
votes
6 answers

How do I use UPX with pyinstaller?

How do I use UPX with pyinstaller? I am following the docs. I have downloaded UPX. My file looks like: import csv import selenium import pandas print('Hello') I then run: pyinstaller -F --upx-dir…
user9062171