Create Executable Python Script with PyInstaller

PyInstaller for Python can be used to create a standalone executable from a Python script.

To create the executable, Python must be installed on the local host. Python can be obtained from here. Currently as of 2018, there is Python versions 2 and 3 available to download.

Before proceeding with the environment setup, test that the pip libraries have been installed with your Python installation with the following command in the Python interpreter:

pip

This will show the command results for the pip command. For any errors with running the pip command, pip may need to be downloaded and installed manually.

Next step is to install PyInstaller. This is done by using the following command within the Python interpreter:

pip install pyinstaller

For PyInstaller on Windows environments, PyWin32 might be required and can be found here

To test Python is running in your environment, test your Python script with the following command:

python your_script.py

Once PyInstaller has been installed, within your Python script directory, the following command can be used with your Python script to create the standalone executable:

pyinstaller --onefile .py

For any other issues with installing or running pip, PyInstaller or Python scripts, you may need to set up your PATH environment variables within your operating system.

Programming Languages

Python
Paradigm: Object-oriented, imperative, functional, procedural, reflective
Typing discipline: Duck, dynamic, strong

Ruby
Paradigm: Multi-paradigm: Object-oriented, imperative, functional, reflective
Typing discipline: Duck, dynamic, strong

C
Paradigm: Imperative (procedural), structured
Typing discipline: Static, weak, manifest, nominal

C++
Paradigm: Multi-paradigm: procedural, functional, object-oriented, generic
Typing discipline: Static, nominative, partially inferred

C#
Paradigm: Structured, imperative, object-oriented, event-driven, task-driven, functional, generic, reflective, concurrent
Typing discipline: Static, dynamic, strong, safe, nominative, partially inferred

Perl
Paradigm: Multi-paradigm, functional, imperative, object-oriented (class-based), reflective, procedural, event-driven, generic
Typing discipline: Dynamic

Java
Paradigm: Multi-paradigm: object-oriented (class-based), structured, imperative, generic, reflective, concurrent
Typing discipline: Static, strong, safe, nominative, manifest

PHP
Paradigm: Imperative, functional, object-oriented, procedural, reflective
Typing discipline: Dynamic, weak