![]() ![]() ![]() If some error occurs, maybe you need to install Microsoft Visual C++ Redistributable. Now our Exe file is saved into the “ dist” folder and you can run it with a double click.ĭuring the execution, you may have noticed that a console appears just for a fraction of a second, if it annoys you, the right compilation command is: pyinstaller -onefile -noconsole main.py To do that we need to open a prompt inside the same directory of the script and write that: pyinstaller -onefile main.py That’s almost done, let’s compile that with Pyinstaller (remembering that the script is inside a file called “main.py”). Now we want to test if everything is ok, so let’s write that simple script that will just create a file (test.txt) with a success message. In order to install that, let’s open a command prompt and write this command: pip install pyinstaller So seems to be the right choice for our python to Exe conversion. PyInstaller is a program that converts (packages) Python scripts into stand-alone executables, under Windows, Linux, and Mac OS X. Now launch the installer, with default values, keeping attention to check “Add Python VERSION to PATH” To do that, click on this link, select the last version and finally download the Windows installer like the image shows: From Python’s official website.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |