{"id":208,"date":"2021-09-28T07:33:24","date_gmt":"2021-09-28T07:33:24","guid":{"rendered":"https:\/\/sznetwork.systems\/?p=208"},"modified":"2025-05-15T15:25:49","modified_gmt":"2025-05-15T13:25:49","slug":"create-executable-from-python-script-with-pyinstaller","status":"publish","type":"post","link":"https:\/\/sznetwork.systems\/?p=208","title":{"rendered":"Create executable from Python Script with Pyinstaller (Migrated)"},"content":{"rendered":"\n<p>Fist install Pyinstaller package<\/p>\n\n\n\n<p>In the Windows Command Prompt, type the following command to install the pyinstaller package (and then press Enter):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>pip install pyinstaller<\/strong><\/pre>\n\n\n\n<p>Create python script youprogram.py<\/p>\n\n\n\n<p>print(&#8220;Compiled version for windows&#8221;)<\/p>\n\n\n\n<p>Next, use the following template to create the executable:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>pyinstaller --onefile yourprogram.py<\/strong><\/pre>\n\n\n\n<p>Run the Executable<\/p>\n\n\n\n<p>Your executable should now get created at the location that you specified in folder &#8220;dist&#8221;.<\/p>\n\n\n\n<p>In Linux all will be same.<br>Small video tutorial in Windows and Linux machines below.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"How to make python script executable\" width=\"500\" height=\"375\" src=\"https:\/\/www.youtube.com\/embed\/ASaRFJFhKRI?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Fist install Pyinstaller package In the Windows Command Prompt, type the following command to install the pyinstaller package (and then press Enter): pip install pyinstaller Create python script youprogram.py print(&#8220;Compiled. <a class=\"read-more-link\" href=\"https:\/\/sznetwork.systems\/?p=208\">read more&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[14],"tags":[27,25,19,26],"class_list":["post-208","post","type-post","status-publish","format-standard","hentry","category-tools","tag-linux","tag-pyinstaller","tag-python","tag-windows"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/posts\/208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=208"}],"version-history":[{"count":5,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/posts\/208\/revisions"}],"predecessor-version":[{"id":1883,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/posts\/208\/revisions\/1883"}],"wp:attachment":[{"href":"https:\/\/sznetwork.systems\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}