{"id":184,"date":"2018-11-19T09:26:29","date_gmt":"2018-11-19T01:26:29","guid":{"rendered":"http:\/\/www.subingkang.com\/?p=184"},"modified":"2025-08-06T13:56:30","modified_gmt":"2025-08-06T05:56:30","slug":"pyinstaller%e5%b0%86py%e6%89%93%e5%8c%85%e6%88%90exe%e7%9a%84%e5%ae%9e%e4%be%8b-python","status":"publish","type":"post","link":"https:\/\/subk.me\/?p=184","title":{"rendered":"Pyinstaller\u5c06py\u6253\u5305\u6210exe\u7684\u5b9e\u4f8b-Python"},"content":{"rendered":"<div><b>\n0x01 \u5b89\u88c5\n<\/b><\/div>\n<div>pip install pyinstaller<\/div>\n<div><b>0x02 \u5e38\u7528\u6307\u4ee4<\/b><\/div>\n<div><\/div>\n<div class=\"wiz-table-container\" style=\"color: gray;position: relative;padding: 0px\">\n<div class=\"wiz-table-body\">\n<table>\n<tbody>\n<tr>\n<th colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">\u53c2\u6570<\/span><\/th>\n<th colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">\u542b \u4e49<\/span><\/th>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">-F<\/span><\/td>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">\u53ea\u751f\u6210\u4e00\u4e2aexe\u6587\u4ef6<\/span><\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">\u2013distpath<\/span><\/td>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">\u6307\u5b9a\u751f\u6210\u7684exe\u5b58\u653e\u7684\u76ee\u5f55<\/span><\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">\u2013workpath<\/span><\/td>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">\u6307\u5b9a\u7f16\u8bd1\u4e2d\u4e34\u65f6\u6587\u4ef6\u5b58\u653e\u7684\u76ee\u5f55<\/span><\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">-D<\/span><\/td>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\u5305\u542b\uff1aexe\u6587\u4ef6\u3001\u4f9d\u8d56\u6587\u4ef6<\/span><\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">-i<\/span><\/td>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">\u6307\u5b9aexe\u56fe\u6807<\/span><\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">-p<\/span><\/td>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">\u6307\u5b9aexe\u4f9d\u8d56\u7684\u5305\u3001\u6a21\u5757<\/span><\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">-d<\/span><\/td>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">\u7f16\u8bd1\u4e3adebug\u6a21\u5f0f\uff0c\u83b7\u53d6\u8fd0\u884c\u4e2d\u7684\u65e5\u5fd7\u4fe1\u606f<\/span><\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">-clean<\/span><\/td>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">\u6e05\u7406\u7f16\u8bd1\u65f6\u4e34\u65f6\u6587\u4ef6<\/span><\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">-c<\/span><\/td>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">\u4f7f\u7528\u63a7\u5236\u53f0<\/span><\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">-w<\/span><\/td>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">\u4f7f\u7528\u7a97\u53e3<\/span><\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">-version-file<\/span><\/td>\n<td colspan=\"1\" rowspan=\"1\"><span data-wiz-span=\"data-wiz-span\">\u6dfb\u52a0exe\u7248\u672c\u4fe1\u606f<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<div style=\"color: gray\"><b><span style=\"color: #000000\" data-wiz-span=\"data-wiz-span\">0x03 \u5b9e\u4f8b<\/span><\/b><\/div>\n<div>\n<pre>C:\\Users\\su\\Desktop\n\u03bb pyinstaller.exe -version\nusage: pyinstaller [-h] [-v] [-D] [-F] [--specpath DIR] [-n NAME]\n[--add-data ]\n[--add-binary ] [-p DIR]\n[--hidden-import MODULENAME]\n[--additional-hooks-dir HOOKSPATH]\n[--runtime-hook RUNTIME_HOOKS] [--exclude-module EXCLUDES]\n[--key KEY] [-d [{all,imports,bootloader,noarchive}]] [-s]\n[--noupx] [-c] [-w]\n[-i ]\n[--version-file FILE] [-m ] [-r RESOURCE]\n[--uac-admin] [--uac-uiaccess] [--win-private-assemblies]\n[--win-no-prefer-redirects]\n[--osx-bundle-identifier BUNDLE_IDENTIFIER]\n[--runtime-tmpdir PATH] [--bootloader-ignore-signals]\n[--distpath DIR] [--workpath WORKPATH] [-y]\n[--upx-dir UPX_DIR] [-a] [--clean] [--log-level LEVEL]\nscriptname [scriptname ...]\npyinstaller: error: argument -v\/--version: ignored explicit argument 'ersion'\n\nC:\\Users\\su\\Desktop\n\u03bb pyinstaller.exe -F C:\\Users\\su\\Desktop\\\u65e5\u5fd7\u767b\u5f55IP\u66ff\u6362\\log_login_ip_replace.py<\/pre>\n<\/div>\n<div style=\"color: gray\">\u4f1a\u5728\u6267\u884c\u76ee\u5f55\u751f\u6210\u4e09\u4e2a\u6587\u4ef6\uff0c\u5176\u4e2dexe\u6587\u4ef6\u5728dist\u76ee\u5f55\u4e0b<\/div>\n<div><\/div>\n<p>\u90e8\u5206\u8be6\u7ec6\u4f7f\u7528\u53ef\u4ee5\u53c2\u8003 <a href=\"https:\/\/hoxis.github.io\/python-pyinstaller.html\"><a href=\"https:\/\/hoxis.github.io\/python-pyinstaller.html\">https:\/\/hoxis.github.io\/python-pyinstaller.html<\/a><\/a><\/p>\n<div id=\"wiz-table-col-line\"><\/div>\n<div id=\"wiz-table-row-line\"><\/div>\n<div id=\"wiz-table-range-border_start\">\n<div id=\"wiz-table-range-border_start_top\"><\/div>\n<div id=\"wiz-table-range-border_start_right\"><\/div>\n<div id=\"wiz-table-range-border_start_bottom\"><\/div>\n<div id=\"wiz-table-range-border_start_left\"><\/div>\n<div id=\"wiz-table-range-border_start_dot\"><\/div>\n<\/div>\n<div id=\"wiz-table-range-border_range\">\n<div id=\"wiz-table-range-border_range_top\"><\/div>\n<div id=\"wiz-table-range-border_range_right\"><\/div>\n<div id=\"wiz-table-range-border_range_bottom\"><\/div>\n<div id=\"wiz-table-range-border_range_left\"><\/div>\n<div id=\"wiz-table-range-border_range_dot\"><\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>0x01 \u5b89\u88c5 pip install pyinstaller 0x02 \u5e38\u7528\u6307\u4ee4 \u53c2\u6570 \u542b \u4e49 -F \u53ea\u751f\u6210 [&hellip;]<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-184","post","type-post","status-publish","format-standard","hentry","category-it"],"_links":{"self":[{"href":"https:\/\/subk.me\/index.php?rest_route=\/wp\/v2\/posts\/184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/subk.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/subk.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/subk.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/subk.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=184"}],"version-history":[{"count":11,"href":"https:\/\/subk.me\/index.php?rest_route=\/wp\/v2\/posts\/184\/revisions"}],"predecessor-version":[{"id":561,"href":"https:\/\/subk.me\/index.php?rest_route=\/wp\/v2\/posts\/184\/revisions\/561"}],"wp:attachment":[{"href":"https:\/\/subk.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/subk.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/subk.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}