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 using python setup.py install
.
Then I created a test python script called test.py
, with the following content:
print('Hello, World!')
Afterwards, I ran the following command to create a single-file executable:
pyinstaller --onefile test.py
The command succeeded, and I verified that the file dist/test.exe
had been generated. However, when I try to run it, all I get is an empty console window. Nothing ever appears, and the program never terminates. It just hangs there forever, until I force close it.
Calling pyinstaller test.py
(without the --onefile
option) works fine. So what is the problem?
Notice that using py2exe
or cx_freeze
is not an option. It has to be pyinstaller
.
UPDATE: I just tested it under Python 2 (using the normal PyInstaller version), and I ran into the same problem. So, this is not just a Python 3 problem.