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
20
votes
8 answers

PyInstaller with Pandas creates over 500 MB exe

I try to create an exe file using PyInstaller 3.2.1, for test purpose I tried to make an exe for following code: import pandas as pd print('hello world') After considerable amount of time (15mins +) I finished with dist folder as big as 620 MB and…
dylan_fan
  • 680
  • 1
  • 5
  • 18
20
votes
1 answer

PyInstaller: Single-file executable doesn't run

I'm trying to create a single-file executable for Windows from a Python application, using pyinstaller. I downloaded the experimental Python 3 branch of pyinstaller from here (the file was python3.zip, but the link is now dead). And I installed it…
Zenadix
  • 15,291
  • 4
  • 26
  • 41
20
votes
3 answers

Python Windows service pyinstaller executables error 1053

I have written a Windows service in python. If I run my script from the command prompt python runService.py When I do this the service installs and starts correctly. I have been trying to create an executable using pyinstaller because i've seen…
user1385894
  • 201
  • 1
  • 2
  • 4
19
votes
5 answers

Embed icon in python script

Does anybody know a way to embed an icon in a Python script such that when I create my standalone executable (using pyinstaller) I don't need to include the .ico file? I know this is possible with py2exe, but in my case I have to use Pyinstaller, as…
maupertius
  • 1,518
  • 4
  • 17
  • 30
19
votes
6 answers

pyinstaller command not found

I am using Ubuntu on VirtualBox. How do I add pyinstaller to the PATH? The issue is when I say pyinstaller file.py it says pyinstaller command not found It says it installed correctly, and according to other posts, I think it has, but I just can't…
Eric Smith
  • 313
  • 1
  • 2
  • 8
19
votes
9 answers

PyInstaller WARNING: lib not found

I know this type of question has been asked here before, but I did not find a working solution to it. I have a python file which I want to convert to an exe on Windows 10. I ran pyinstaller --onefile --noconsole myfile.py, and it outputted a lot of…
Conner Dassen
  • 729
  • 4
  • 11
  • 28
19
votes
1 answer

How to add dynamic python modules to PyInstaller's specs?

I'm trying to figure out how to load dynamic/hidden imports with PyInstaller, so far I got this simple structure: First of all, I got a framework package added into my PYTHONPATH living in d:\Sources\personal\python\framework That package is used by…
BPL
  • 9,632
  • 9
  • 59
  • 117
19
votes
3 answers

How to create OS X app with Python on Windows

I need to automate a cross-platform application build. Entire build runs on Windows machine. Part of it is written in Python and compiles for OS X. Currently this part of build is done manually on OS X. I tried pyinstaller but it looks like it only…
IT Hit WebDAV
  • 5,652
  • 12
  • 61
  • 98
19
votes
2 answers

pyInstaller loads script multiple times

I've managed to get pyinstaller to run more or less correctly now, except that it opens too many windows. It's pygame project, and it keeps loading the entire thing over again every second or so. My PC fills with game windows after a few seconds and…
Oliver
  • 1,395
  • 1
  • 14
  • 33
19
votes
3 answers

exe-file created by pyinstaller, not find self-defined modules while running

I create two python files, and the directory/file relations is as follows: mytest--- |---mycommon.py |---myMainDir--- |----myMain.py In mycommon.py: def myFunc(a): ... And in myMain.py: import…
DarkMagic
  • 213
  • 1
  • 2
  • 6
18
votes
6 answers

How to build an mac os app from a python script having a PySide2 GUI?

Context: I am developping a simple Python application using a PySide2 GUI. It currently works fine in Windows, Linux and Mac. On Windows, I could use PyInstaller and InnoSetup to build a simple installer. Then I tried to do the same thing on Mac. It…
Serge Ballesta
  • 143,923
  • 11
  • 122
  • 252
18
votes
6 answers

Fatal Python error: initfsencoding: unable to load the file system codec

I have created a .exe file of a simple script with intentions to run it on a server however I cannot seem to figure out what this fault means or find any answers online. The fault code is as follows: Fatal Python error: initfsencoding: unable to…
EcSync
  • 842
  • 1
  • 6
  • 20
18
votes
7 answers

Exception: Cannot find PyQt5 plugin directories when using Pyinstaller despite PyQt5 not even being used

A month ago I solved my applcation freezing issues for Python 2.7 as you can see here. I have since adapted my code to python 3.5 (using Anaconda) and it appears to be working. couldn't get pyinstaller working with Anaconda so switched to trying to…
Frikster
  • 2,755
  • 5
  • 37
  • 71
18
votes
2 answers

PyInstaller Encryption --key

I'm trying to understand why PyInstaller documentation states that the --key argument to encrypt Python source code can be easily extracted: Additionally, Python bytecode can be obfuscated with AES256 by specifying an encryption key on PyInstaller’s…
Luca Brasi
  • 681
  • 2
  • 12
  • 28
18
votes
4 answers

How do I include .dll file in executable using pyinstaller?

I want to generate a single executable file from my python script. For this I use pyinstaller. I had issues with mkl libraries because I use numpy in the script. I used this hook so solve the issue, it worked fine. But it does not work if I copy the…
David P
  • 317
  • 2
  • 3
  • 9