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
30
votes
2 answers

How to properly create a pyinstaller hook, or maybe hidden import?

I have two packages (say, dataread and datainspector) that were somehow not detected by PyInstaller. Because of this, the application terminates when the running application reaches the point where it needs to import modules from those packages. The…
swdev
  • 4,997
  • 8
  • 64
  • 106
29
votes
2 answers

Using --onefile with a .spec in PyInstaller

I'm "compiling" a program using PyInstaller using a .spec file. I'm using the .spec file because I need to include an extra file in the program. When I try to do PyInstaller --onefile Prog.spec, it still makes a folder in dist with all the files…
TheStrangeQuark
  • 2,257
  • 5
  • 31
  • 58
28
votes
4 answers

No module named 'pandas._libs.tslibs.timedeltas' in PyInstaller

I am trying to wrap a Python script into an exe using PyInstaller (development version) for windows. The script uses Pandas and I have been running into an error when running the exe. Traceback (most recent call last): File…
Eduard Fidler
  • 313
  • 1
  • 4
  • 7
28
votes
4 answers

Auto updating a python executable generated with pyinstaller

I have a desktop app that I'm working on and I am using PyInstaller to generate de distribution files. I have chosen PyInstaller over py2exe because it is very easy to use and I don't need to care about windows dlls, but when I use py2exe I can…
Fernando Freitas Alves
  • 3,709
  • 3
  • 26
  • 45
27
votes
1 answer

How can i make a application with single .exe file using python?

Possible Duplicate: py2exe - generate single executable file I made a application.exe from application.py using "pyinstaller".There are so many .dll file generated during this process. How can i make a application with single .exe file
EbinPaulose
  • 1,129
  • 3
  • 14
  • 26
26
votes
7 answers

PyInstaller, how to include data files from an external package that was installed by pip?

Problem I am attempting to use PyInstaller to create an application for internal use within my company. The script works great from a working python environment, but loses something when translated to a package. I know how to include and reference…
slightlynybbled
  • 2,408
  • 2
  • 20
  • 38
26
votes
5 answers

python requests can't find a folder with a certificate when converted to .exe

I have a program that pools ad stats from different marketing systems. Everything works fine untill i convert it to the .exe format and run it. Exception in Tkinter callback Traceback (most recent call last): File…
26
votes
11 answers

Pyinstaller and --onefile: How to include an image in the exe file

I have created an exe file using Pyinstaller. pyinstaller.exe --onefile --icon='Loco.ico program.py In the program, I include an image in my plots, and when I run the program alone in its folder, I get the following: IOError: [Errno 2] No such file…
Nautilius
  • 1,581
  • 2
  • 12
  • 14
26
votes
2 answers

PyInstaller-built Windows EXE fails with multiprocessing

In my project I'm using Python's multiprocessing library to create multiple processes in __main__. The project is being packaged into a single Windows EXE using PyInstaller 2.1.1. I create new processes like so: from multiprocessing import…
nikola
  • 2,241
  • 4
  • 30
  • 42
26
votes
2 answers

Building Cython-compiled python code with PyInstaller

I am trying to build a Python multi-file code with PyInstaller. For that I have compiled the code with Cython, and am using .so files generated in place of .py files. Assuming the 1st file is main.py and the imported ones are file_a.py and…
Confused
  • 617
  • 1
  • 9
  • 17
25
votes
5 answers

Adding a data file in Pyinstaller using the onefile option

I'm trying to add an image to the one file produced by Pyinstaller. I've read many questions/forums like this one and that one and still it's not working. I know that for one file operation, Pyinstller produce a temp folder that could be reached by…
AhmedWas
  • 1,205
  • 3
  • 23
  • 38
25
votes
5 answers

How to include dependencies from venv directory when running pyinstaller for project built in Pycharm?

I'm new to Python and PyCharm. I'm running on OSX High Sierra. I've created a project in PyCharm that uses lxml. I've installed lxml 4.1.1 as a project dependency, and I can see it's files under myProject/venv/lib/site-package/lxml I can run my…
George
  • 579
  • 1
  • 5
  • 12
25
votes
5 answers

Pyinstaller --onefile warning pyconfig.h when importing scipy or scipy.signal

This is very simple to recreate. If my script foo.py is: import scipy Then run: python pyinstaller.py --onefile foo.py When I launch foo.exe I get: WARNING: file already exists but should not:…
Jonno
  • 767
  • 2
  • 7
  • 13
24
votes
5 answers

How to use pyinstaller?

Okay so I'm a complete noob in programming and I'm trying to compile a simple program I wrote that takes in a string and prints out the string in morse code it's called morse.py. I installed pyinstaller using pip install pyinstaller and I am…
user3333708
  • 387
  • 1
  • 5
  • 10
24
votes
10 answers

PyInstaller and Pandas

I have a fairly simple Python module that I am trying to compile into a Windows .exe file. In my script I am using the wxPython and Pandas libraries. The PyInstaller .exe file that is generated only works/opens when the Pandas library is excluded…
Gohawks
  • 1,044
  • 3
  • 12
  • 26