{"id":27019070,"url":"https://github.com/jabbalaci/pythonexe","last_synced_at":"2025-04-04T17:18:55.334Z","repository":{"id":140437717,"uuid":"169917944","full_name":"jabbalaci/PythonEXE","owner":"jabbalaci","description":"How to create an executable file from a Python script?","archived":false,"fork":false,"pushed_at":"2023-07-25T16:12:09.000Z","size":337,"stargazers_count":280,"open_issues_count":2,"forks_count":29,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-11-19T22:44:06.047Z","etag":null,"topics":["exe","pipenv","pyinstaller","python","python3","virtual-environment"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jabbalaci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-02-09T21:55:13.000Z","updated_at":"2024-09-03T03:37:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"d0a0a5ed-65d4-4932-bc39-2acde012f673","html_url":"https://github.com/jabbalaci/PythonEXE","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jabbalaci%2FPythonEXE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jabbalaci%2FPythonEXE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jabbalaci%2FPythonEXE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jabbalaci%2FPythonEXE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jabbalaci","download_url":"https://codeload.github.com/jabbalaci/PythonEXE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217217,"owners_count":20903009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exe","pipenv","pyinstaller","python","python3","virtual-environment"],"created_at":"2025-04-04T17:18:54.732Z","updated_at":"2025-04-04T17:18:55.305Z","avatar_url":"https://github.com/jabbalaci.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Python EXE Maker\n================\n\nThis little project shows you how to build an executable file\nof your Python code.\n\nHere, `hello.py` is the main file. It uses a module (`helper.py`),\nit imports the `os` module from the stdlib, and it even uses\na 3rd-party library (`requests`).\n\nWith PyInstaller, you can easily create a single executable file from\nthis project.\n\n    $ pyinstaller --onefile hello.py\n\nUnder Windows you might have a problem with this. If the `.exe` complains that\na DLL is missing, then try this variation:\n\n    $ pyinstaller --onefile --noupx hello.py\n\nYou'll find the exe in the `dist/` folder.\n\nWhy would you need an EXE?\n--------------------------\n\nEXE is a file extension for an executable file format. It makes distributing your\nprogram much easier. The exe produced by PyInstaller is standalone.\nIt means that it's enough to give this exe to your friend and (s)he can run it right away.\nThere is no need to install Python on his/her machine, no need to create a virtual environment, etc.\nUnder Windows you can simply start an exe with a double click.\n\nOf course, if your friend uses Windows (Linux), then create the exe under\nWindows (Linux).\n\nWill my EXE run faster?\n-----------------------\n\n**No.** PyInstaller simply creates a bundle that contains everything: your code,\nthe necessary modules / packages, the virtual environment, the Python interpreter, etc.\nWhen you launch the EXE, it is extracted to your temp folder (under Linux\nit's the `/tmp` folder), and your application is started from there. So the\nruntime will be approximately the same.\n\nFor a demo, check out my simple Fibonacci implementation in the folder `speed_test`.\n\npynt\n----\n\n[pynt](https://github.com/rags/pynt) is a minimalistic build tool. If you installed everything\nwith poetry (`poetry install`), then you can also create the executable with the following commands:\n\n    $ pynt exe\n\nor (using pyinstaller's `--noupx` switch)\n\n    $ pynt exe2\n\nVideo\n-----\n\nClick on the image below to open a YouTube video that shows you everything step-by-step:\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://www.youtube.com/watch?v=2XBjnfx3g3U\"\u003e\u003cimg width=\"60%\" src=\"assets/screenshot.png\" alt=\"view demo on YouTube\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\nChanges since the video was made:\n\n* The project was updated for Python 3.8 and PyInstaller 4.0.\n* In the video I talk about pipenv, but the project was updated\nto use [poetry](https://python-poetry.org/). I tried both pipenv and poetry and [I prefer\npoetry](https://pythonadventures.wordpress.com/2019/11/02/moving-from-pipenv-to-poetry/).\n\nLinks / News / Related Work\n---------------------------\n\n* This project of mine got included in [PyCoder's Weekly -- Issue #355](https://pycoders.com/issues/355)\nunder the title \"PythonEXE: How to Create an Executable File From a Python Script?\"\n* Reddit discussion: [here](https://old.reddit.com/r/learnpython/comments/aoxoki/i_made_a_sample_project_to_demonstrate_how_to/).\n* [Using PyInstaller to Easily Distribute Python Applications](https://realpython.com/pyinstaller-python/),\na blog post on the same topic\n* [PyUpdater](https://github.com/JMSwag/PyUpdater), a pyinstaller auto-update framework\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjabbalaci%2Fpythonexe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjabbalaci%2Fpythonexe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjabbalaci%2Fpythonexe/lists"}