{"id":1183211,"date":"2025-01-15T19:12:00","date_gmt":"2025-01-15T11:12:00","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1183211.html"},"modified":"2025-01-15T19:12:03","modified_gmt":"2025-01-15T11:12:03","slug":"python%e5%a6%82%e4%bd%95%e6%89%93%e5%8c%85exe%e6%96%87%e4%bb%b6%e8%b7%af%e5%be%84","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1183211.html","title":{"rendered":"python\u5982\u4f55\u6253\u5305exe\u6587\u4ef6\u8def\u5f84"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25133028\/c1a68de6-bb3c-4096-8ad9-ee2c906fab6c.webp\" alt=\"python\u5982\u4f55\u6253\u5305exe\u6587\u4ef6\u8def\u5f84\" \/><\/p>\n<p><p> <strong>Python\u6253\u5305exe\u6587\u4ef6\u8def\u5f84\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5e38\u89c1\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528PyInstaller\u3001cx_Freeze\u3001py2exe\u7b49\u5de5\u5177\u3002\u901a\u8fc7\u4f7f\u7528\u8fd9\u4e9b\u5de5\u5177\u53ef\u4ee5\u5c06Python\u811a\u672c\u6253\u5305\u6210\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u4ece\u800c\u65b9\u4fbf\u5728\u6ca1\u6709Python\u73af\u5883\u7684\u7535\u8111\u4e0a\u8fd0\u884c\u3002<\/strong> \u63a8\u8350\u4f7f\u7528PyInstaller\uff0c\u56e0\u4e3a\u5b83\u7684\u914d\u7f6e\u76f8\u5bf9\u7b80\u5355\u5e76\u4e14\u529f\u80fd\u5f3a\u5927\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528PyInstaller\u5c06Python\u811a\u672c\u6253\u5305\u6210exe\u6587\u4ef6\u7684\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<p><p><strong>PyInstaller\u7684\u5b89\u88c5\u548c\u4f7f\u7528\u975e\u5e38\u7b80\u5355\u3002\u9996\u5148\uff0c\u786e\u4fdd\u4f60\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u548cpip\uff0c\u7136\u540e\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5PyInstaller\uff1a<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pip install pyinstaller<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u8fdb\u5165\u4f60\u7684Python\u811a\u672c\u6240\u5728\u7684\u76ee\u5f55\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u6253\u5305\u4f60\u7684\u811a\u672c\uff1a<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pyinstaller --onefile your_script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e2a\u547d\u4ee4\u5c06\u628a\u4f60\u7684\u811a\u672c\u6253\u5305\u6210\u4e00\u4e2a\u5355\u72ec\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u5e76\u5c06\u5176\u8f93\u51fa\u5230<code>dist<\/code>\u76ee\u5f55\u4e0b\u3002<\/p>\n<\/p>\n<hr>\n<h2><strong>\u4e00\u3001PYINSTALLER\u7b80\u4ecb<\/strong><\/h2>\n<p><p>PyInstaller\u662f\u4e00\u6b3e\u5c06Python\u7a0b\u5e8f\u6253\u5305\u6210\u72ec\u7acb\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5de5\u5177\u3002\u5b83\u901a\u8fc7\u5206\u6790Python\u811a\u672c\u7684\u4f9d\u8d56\u5173\u7cfb\uff0c\u5e76\u5c06\u6240\u6709\u5fc5\u8981\u7684\u6587\u4ef6\u6253\u5305\u5230\u4e00\u4e2a\u5355\u72ec\u7684\u6587\u4ef6\u6216\u6587\u4ef6\u5939\u4e2d\uff0c\u4f7f\u5f97\u7528\u6237\u53ef\u4ee5\u5728\u6ca1\u6709Python\u73af\u5883\u7684\u673a\u5668\u4e0a\u8fd0\u884c\u8fd9\u4e9b\u7a0b\u5e8f\u3002PyInstaller\u652f\u6301\u591a\u79cd\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5305\u62ecWindows\u3001MacOS\u548cLinux\u3002<\/p>\n<\/p>\n<p><h2>1\u3001PyInstaller\u7684\u4f18\u70b9<\/h2>\n<\/p>\n<p><h3>a\u3001\u591a\u5e73\u53f0\u652f\u6301<\/h3>\n<\/p>\n<p><p>PyInstaller\u652f\u6301Windows\u3001MacOS\u548cLinux\uff0c\u8fd9\u4f7f\u5f97\u5b83\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u90fd\u80fd\u4f7f\u7528\u3002\u65e0\u8bba\u4f60\u662f\u5728Windows\u4e0a\u5f00\u53d1\uff0c\u8fd8\u662f\u5728MacOS\u6216Linux\u4e0a\u5f00\u53d1\uff0c\u90fd\u53ef\u4ee5\u4f7f\u7528PyInstaller\u6765\u6253\u5305\u4f60\u7684Python\u811a\u672c\u3002<\/p>\n<\/p>\n<p><h3>b\u3001\u7b80\u5355\u6613\u7528<\/h3>\n<\/p>\n<p><p>PyInstaller\u7684\u5b89\u88c5\u548c\u4f7f\u7528\u975e\u5e38\u7b80\u5355\u3002\u901a\u8fc7\u7b80\u5355\u7684\u547d\u4ee4\u884c\u64cd\u4f5c\uff0c\u5c31\u53ef\u4ee5\u8f7b\u677e\u5730\u5c06Python\u811a\u672c\u6253\u5305\u6210\u53ef\u6267\u884c\u6587\u4ef6\u3002\u5b83\u7684\u914d\u7f6e\u6587\u4ef6\u4e5f\u5f88\u76f4\u89c2\uff0c\u7528\u6237\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u8fdb\u884c\u5b9a\u5236\u5316\u6253\u5305\u3002<\/p>\n<\/p>\n<p><h2>2\u3001PyInstaller\u7684\u7f3a\u70b9<\/h2>\n<\/p>\n<p><h3>a\u3001\u6253\u5305\u6587\u4ef6\u8f83\u5927<\/h3>\n<\/p>\n<p><p>\u7531\u4e8ePython\u672c\u8eab\u7684\u5e93\u6bd4\u8f83\u591a\uff0c\u6253\u5305\u540e\u7684\u53ef\u6267\u884c\u6587\u4ef6\u5f80\u5f80\u6bd4\u8f83\u5927\u3002\u8fd9\u53ef\u80fd\u4f1a\u5360\u7528\u8f83\u591a\u7684\u78c1\u76d8\u7a7a\u95f4\uff0c\u5e76\u4e14\u5728\u5206\u53d1\u65f6\u9700\u8981\u66f4\u591a\u7684\u65f6\u95f4\u3002<\/p>\n<\/p>\n<p><h3>b\u3001\u4f9d\u8d56\u7ba1\u7406\u590d\u6742<\/h3>\n<\/p>\n<p><p>\u867d\u7136PyInstaller\u53ef\u4ee5\u81ea\u52a8\u5206\u6790\u5e76\u6253\u5305\u5927\u90e8\u5206\u4f9d\u8d56\u9879\uff0c\u4f46\u6709\u4e9b\u7279\u6b8a\u7684\u5e93\u6216\u6a21\u5757\u53ef\u80fd\u9700\u8981\u624b\u52a8\u914d\u7f6e\u3002\u8fd9\u5bf9\u4e8e\u521d\u5b66\u8005\u6765\u8bf4\u53ef\u80fd\u6709\u4e9b\u590d\u6742\u3002<\/p>\n<\/p>\n<hr>\n<h2><strong>\u4e8c\u3001PYINSTALLER\u7684\u57fa\u672c\u4f7f\u7528<\/strong><\/h2>\n<p><h2>1\u3001\u5b89\u88c5PyInstaller<\/h2>\n<\/p>\n<p><p>\u5728\u4f7f\u7528PyInstaller\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u4f60\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u548cpip\u3002\u7136\u540e\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5PyInstaller\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pip install pyinstaller<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u9a8c\u8bc1\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pyinstaller --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>2\u3001\u6253\u5305Python\u811a\u672c<\/h2>\n<\/p>\n<p><p>\u8fdb\u5165\u4f60\u7684Python\u811a\u672c\u6240\u5728\u7684\u76ee\u5f55\uff0c\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u6253\u5305\u4f60\u7684\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pyinstaller --onefile your_script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e2a\u547d\u4ee4\u5c06\u628a\u4f60\u7684\u811a\u672c\u6253\u5305\u6210\u4e00\u4e2a\u5355\u72ec\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u5e76\u5c06\u5176\u8f93\u51fa\u5230<code>dist<\/code>\u76ee\u5f55\u4e0b\u3002<code>--onefile<\/code>\u9009\u9879\u8868\u793a\u5c06\u6240\u6709\u6587\u4ef6\u6253\u5305\u6210\u4e00\u4e2a\u5355\u72ec\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h2>3\u3001\u5e38\u7528\u9009\u9879<\/h2>\n<\/p>\n<p><h3>a\u3001&#8211;onefile<\/h3>\n<\/p>\n<p><p>\u5c06\u6240\u6709\u6587\u4ef6\u6253\u5305\u6210\u4e00\u4e2a\u5355\u72ec\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002\u4f7f\u7528\u8fd9\u4e2a\u9009\u9879\u53ef\u4ee5\u751f\u6210\u4e00\u4e2a\u4fbf\u4e8e\u5206\u53d1\u548c\u7ba1\u7406\u7684\u5355\u72ec\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pyinstaller --onefile your_script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>b\u3001&#8211;noconsole<\/h3>\n<\/p>\n<p><p>\u5728Windows\u4e0a\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cPyInstaller\u6253\u5305\u7684\u53ef\u6267\u884c\u6587\u4ef6\u4f1a\u5f39\u51fa\u4e00\u4e2a\u63a7\u5236\u53f0\u7a97\u53e3\u3002\u5982\u679c\u4f60\u4e0d\u5e0c\u671b\u663e\u793a\u8fd9\u4e2a\u63a7\u5236\u53f0\u7a97\u53e3\uff0c\u53ef\u4ee5\u4f7f\u7528<code>--noconsole<\/code>\u9009\u9879\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pyinstaller --noconsole your_script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>c\u3001&#8211;icon<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528\u81ea\u5b9a\u4e49\u56fe\u6807\u4e3a\u6253\u5305\u7684\u53ef\u6267\u884c\u6587\u4ef6\u8bbe\u7f6e\u56fe\u6807\u3002\u56fe\u6807\u6587\u4ef6\u5e94\u4e3a<code>.ico<\/code>\u683c\u5f0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pyinstaller --onefile --icon=your_icon.ico your_script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<hr>\n<h2><strong>\u4e09\u3001PYINSTALLER\u7684\u9ad8\u7ea7\u4f7f\u7528<\/strong><\/h2>\n<p><h2>1\u3001\u4f7f\u7528.spec\u6587\u4ef6<\/h2>\n<\/p>\n<p><p>PyInstaller\u5728\u6253\u5305\u8fc7\u7a0b\u4e2d\u4f1a\u751f\u6210\u4e00\u4e2a<code>.spec<\/code>\u6587\u4ef6\uff0c\u8fd9\u4e2a\u6587\u4ef6\u5305\u542b\u4e86\u6253\u5305\u8fc7\u7a0b\u4e2d\u7684\u6240\u6709\u914d\u7f6e\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u8fd9\u4e2a\u6587\u4ef6\u6765\u5b9a\u5236\u6253\u5305\u8fc7\u7a0b\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684<code>.spec<\/code>\u6587\u4ef6\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># -*- mode: python -*-<\/p>\n<p>block_cipher = None<\/p>\n<p>a = Analysis([&#39;your_script.py&#39;],<\/p>\n<p>             pathex=[&#39;\/path\/to\/your\/script&#39;],<\/p>\n<p>             binaries=[],<\/p>\n<p>             datas=[],<\/p>\n<p>             hiddenimports=[],<\/p>\n<p>             hookspath=[],<\/p>\n<p>             runtime_hooks=[],<\/p>\n<p>             excludes=[],<\/p>\n<p>             win_no_prefer_redirects=False,<\/p>\n<p>             win_private_assemblies=False,<\/p>\n<p>             cipher=block_cipher)<\/p>\n<p>pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)<\/p>\n<p>exe = EXE(pyz,<\/p>\n<p>          a.scripts,<\/p>\n<p>          [],<\/p>\n<p>          exclude_binaries=True,<\/p>\n<p>          name=&#39;your_script&#39;,<\/p>\n<p>          debug=False,<\/p>\n<p>          bootloader_ignore_signals=False,<\/p>\n<p>          strip=False,<\/p>\n<p>          upx=True,<\/p>\n<p>          console=True )<\/p>\n<p>coll = COLLECT(exe,<\/p>\n<p>               a.binaries,<\/p>\n<p>               a.zipfiles,<\/p>\n<p>               a.datas,<\/p>\n<p>               strip=False,<\/p>\n<p>               upx=True,<\/p>\n<p>               name=&#39;your_script&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4fee\u6539\u8fd9\u4e2a\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u81ea\u5b9a\u4e49\u6253\u5305\u7684\u8fc7\u7a0b\uff0c\u6bd4\u5982\u6dfb\u52a0\u989d\u5916\u7684\u6587\u4ef6\u3001\u8bbe\u7f6e\u9690\u85cf\u7684\u5bfc\u5165\u6a21\u5757\u7b49\u3002\u7136\u540e\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u4f7f\u7528\u8fd9\u4e2a<code>.spec<\/code>\u6587\u4ef6\u8fdb\u884c\u6253\u5305\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pyinstaller your_script.spec<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>2\u3001\u6dfb\u52a0\u6570\u636e\u6587\u4ef6<\/h2>\n<\/p>\n<p><p>\u6709\u65f6\u5019\u4f60\u7684Python\u811a\u672c\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u989d\u5916\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6bd4\u5982\u914d\u7f6e\u6587\u4ef6\u3001\u56fe\u7247\u7b49\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u5728<code>.spec<\/code>\u6587\u4ef6\u4e2d\u7684<code>datas<\/code>\u53c2\u6570\u4e2d\u6dfb\u52a0\u8fd9\u4e9b\u6587\u4ef6\u6765\u5c06\u5b83\u4eec\u6253\u5305\u5230\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">datas=[(&#39;data\/config.json&#39;, &#39;data&#39;)]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>3\u3001\u9690\u85cf\u5bfc\u5165\u6a21\u5757<\/h2>\n<\/p>\n<p><p>\u6709\u4e9b\u5e93\u53ef\u80fd\u4f1a\u52a8\u6001\u5bfc\u5165\u6a21\u5757\uff0c\u8fd9\u4e9b\u6a21\u5757\u5728\u9759\u6001\u5206\u6790\u65f6\u65e0\u6cd5\u88ab\u68c0\u6d4b\u5230\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u5728<code>.spec<\/code>\u6587\u4ef6\u4e2d\u7684<code>hiddenimports<\/code>\u53c2\u6570\u4e2d\u6dfb\u52a0\u8fd9\u4e9b\u6a21\u5757\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">hiddenimports=[&#39;module1&#39;, &#39;module2&#39;]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<hr>\n<h2><strong>\u56db\u3001CX_FREEZE\u7b80\u4ecb<\/strong><\/h2>\n<p><p>cx_Freeze\u662f\u53e6\u4e00\u6b3e\u5c06Python\u811a\u672c\u6253\u5305\u6210\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5de5\u5177\u3002\u5b83\u652f\u6301\u591a\u5e73\u53f0\uff0c\u5305\u62ecWindows\u3001MacOS\u548cLinux\u3002\u4e0ePyInstaller\u7c7b\u4f3c\uff0ccx_Freeze\u4e5f\u53ef\u4ee5\u5c06Python\u811a\u672c\u53ca\u5176\u4f9d\u8d56\u9879\u6253\u5305\u6210\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h2>1\u3001cx_Freeze\u7684\u4f18\u70b9<\/h2>\n<\/p>\n<p><h3>a\u3001\u591a\u5e73\u53f0\u652f\u6301<\/h3>\n<\/p>\n<p><p>cx_Freeze\u652f\u6301Windows\u3001MacOS\u548cLinux\uff0c\u8fd9\u4f7f\u5f97\u5b83\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u90fd\u80fd\u4f7f\u7528\u3002\u65e0\u8bba\u4f60\u662f\u5728Windows\u4e0a\u5f00\u53d1\uff0c\u8fd8\u662f\u5728MacOS\u6216Linux\u4e0a\u5f00\u53d1\uff0c\u90fd\u53ef\u4ee5\u4f7f\u7528cx_Freeze\u6765\u6253\u5305\u4f60\u7684Python\u811a\u672c\u3002<\/p>\n<\/p>\n<p><h3>b\u3001\u7075\u6d3b\u6027\u9ad8<\/h3>\n<\/p>\n<p><p>cx_Freeze\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u914d\u7f6e\u9009\u9879\uff0c\u5141\u8bb8\u7528\u6237\u5bf9\u6253\u5305\u8fc7\u7a0b\u8fdb\u884c\u7cbe\u7ec6\u7684\u63a7\u5236\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u6765\u6307\u5b9a\u9700\u8981\u6253\u5305\u7684\u6587\u4ef6\u3001\u4f9d\u8d56\u9879\u3001\u8fd0\u884c\u65f6\u9009\u9879\u7b49\u3002<\/p>\n<\/p>\n<p><h2>2\u3001cx_Freeze\u7684\u7f3a\u70b9<\/h2>\n<\/p>\n<p><h3>a\u3001\u914d\u7f6e\u8f83\u590d\u6742<\/h3>\n<\/p>\n<p><p>\u4e0ePyInstaller\u76f8\u6bd4\uff0ccx_Freeze\u7684\u914d\u7f6e\u76f8\u5bf9\u590d\u6742\u3002\u521d\u5b66\u8005\u53ef\u80fd\u9700\u8981\u66f4\u591a\u7684\u65f6\u95f4\u6765\u719f\u6089\u5b83\u7684\u4f7f\u7528\u65b9\u6cd5\u548c\u914d\u7f6e\u9009\u9879\u3002<\/p>\n<\/p>\n<p><h3>b\u3001\u793e\u533a\u652f\u6301\u8f83\u5c11<\/h3>\n<\/p>\n<p><p>cx_Freeze\u7684\u793e\u533a\u652f\u6301\u76f8\u5bf9\u8f83\u5c11\uff0c\u9047\u5230\u95ee\u9898\u65f6\u53ef\u80fd\u9700\u8981\u66f4\u591a\u7684\u65f6\u95f4\u6765\u67e5\u627e\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<\/p>\n<hr>\n<h2><strong>\u4e94\u3001CX_FREEZE\u7684\u57fa\u672c\u4f7f\u7528<\/strong><\/h2>\n<p><h2>1\u3001\u5b89\u88c5cx_Freeze<\/h2>\n<\/p>\n<p><p>\u5728\u4f7f\u7528cx_Freeze\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u4f60\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u548cpip\u3002\u7136\u540e\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5cx_Freeze\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pip install cx_Freeze<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u9a8c\u8bc1\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">python -m cx_Freeze --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>2\u3001\u521b\u5efasetup\u811a\u672c<\/h2>\n<\/p>\n<p><p>\u8981\u4f7f\u7528cx_Freeze\u6253\u5305Python\u811a\u672c\uff0c\u9996\u5148\u9700\u8981\u521b\u5efa\u4e00\u4e2a<code>setup.py<\/code>\u6587\u4ef6\u6765\u914d\u7f6e\u6253\u5305\u8fc7\u7a0b\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684<code>setup.py<\/code>\u6587\u4ef6\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from cx_Freeze import setup, Executable<\/p>\n<h2><strong>\u8bbe\u7f6e\u811a\u672c\u6587\u4ef6\u548c\u53ef\u6267\u884c\u6587\u4ef6\u7684\u540d\u79f0<\/strong><\/h2>\n<p>script = &#39;your_script.py&#39;<\/p>\n<p>exe_name = &#39;your_script&#39;<\/p>\n<h2><strong>\u521b\u5efaExecutable\u5bf9\u8c61<\/strong><\/h2>\n<p>exe = Executable(script, targetName=exe_name)<\/p>\n<h2><strong>\u8c03\u7528setup\u51fd\u6570\u8fdb\u884c\u6253\u5305<\/strong><\/h2>\n<p>setup(<\/p>\n<p>    name=exe_name,<\/p>\n<p>    version=&#39;1.0&#39;,<\/p>\n<p>    description=&#39;Description of your script&#39;,<\/p>\n<p>    executables=[exe]<\/p>\n<p>)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>3\u3001\u8fd0\u884csetup\u811a\u672c<\/h2>\n<\/p>\n<p><p>\u521b\u5efa\u597d<code>setup.py<\/code>\u6587\u4ef6\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u8fd0\u884c\u5b83\u5e76\u8fdb\u884c\u6253\u5305\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">python setup.py build<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e2a\u547d\u4ee4\u5c06\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u751f\u6210\u4e00\u4e2a<code>build<\/code>\u6587\u4ef6\u5939\uff0c\u91cc\u9762\u5305\u542b\u4e86\u6253\u5305\u540e\u7684\u53ef\u6267\u884c\u6587\u4ef6\u53ca\u5176\u4f9d\u8d56\u9879\u3002<\/p>\n<\/p>\n<hr>\n<h2><strong>\u516d\u3001CX_FREEZE\u7684\u9ad8\u7ea7\u4f7f\u7528<\/strong><\/h2>\n<p><h2>1\u3001\u6dfb\u52a0\u6570\u636e\u6587\u4ef6<\/h2>\n<\/p>\n<p><p>\u6709\u65f6\u5019\u4f60\u7684Python\u811a\u672c\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u989d\u5916\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6bd4\u5982\u914d\u7f6e\u6587\u4ef6\u3001\u56fe\u7247\u7b49\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u5728<code>setup.py<\/code>\u6587\u4ef6\u4e2d\u7684<code>include_files<\/code>\u53c2\u6570\u4e2d\u6dfb\u52a0\u8fd9\u4e9b\u6587\u4ef6\u6765\u5c06\u5b83\u4eec\u6253\u5305\u5230\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from cx_Freeze import setup, Executable<\/p>\n<h2><strong>\u8bbe\u7f6e\u811a\u672c\u6587\u4ef6\u548c\u53ef\u6267\u884c\u6587\u4ef6\u7684\u540d\u79f0<\/strong><\/h2>\n<p>script = &#39;your_script.py&#39;<\/p>\n<p>exe_name = &#39;your_script&#39;<\/p>\n<h2><strong>\u6dfb\u52a0\u6570\u636e\u6587\u4ef6<\/strong><\/h2>\n<p>include_files = [(&#39;data\/config.json&#39;, &#39;data&#39;)]<\/p>\n<h2><strong>\u521b\u5efaExecutable\u5bf9\u8c61<\/strong><\/h2>\n<p>exe = Executable(script, targetName=exe_name)<\/p>\n<h2><strong>\u8c03\u7528setup\u51fd\u6570\u8fdb\u884c\u6253\u5305<\/strong><\/h2>\n<p>setup(<\/p>\n<p>    name=exe_name,<\/p>\n<p>    version=&#39;1.0&#39;,<\/p>\n<p>    description=&#39;Description of your script&#39;,<\/p>\n<p>    options={&#39;build_exe&#39;: {&#39;include_files&#39;: include_files}},<\/p>\n<p>    executables=[exe]<\/p>\n<p>)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>2\u3001\u9690\u85cf\u5bfc\u5165\u6a21\u5757<\/h2>\n<\/p>\n<p><p>\u6709\u4e9b\u5e93\u53ef\u80fd\u4f1a\u52a8\u6001\u5bfc\u5165\u6a21\u5757\uff0c\u8fd9\u4e9b\u6a21\u5757\u5728\u9759\u6001\u5206\u6790\u65f6\u65e0\u6cd5\u88ab\u68c0\u6d4b\u5230\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u5728<code>setup.py<\/code>\u6587\u4ef6\u4e2d\u7684<code>packages<\/code>\u53c2\u6570\u4e2d\u6dfb\u52a0\u8fd9\u4e9b\u6a21\u5757\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from cx_Freeze import setup, Executable<\/p>\n<h2><strong>\u8bbe\u7f6e\u811a\u672c\u6587\u4ef6\u548c\u53ef\u6267\u884c\u6587\u4ef6\u7684\u540d\u79f0<\/strong><\/h2>\n<p>script = &#39;your_script.py&#39;<\/p>\n<p>exe_name = &#39;your_script&#39;<\/p>\n<h2><strong>\u9690\u85cf\u5bfc\u5165\u6a21\u5757<\/strong><\/h2>\n<p>hiddenimports = [&#39;module1&#39;, &#39;module2&#39;]<\/p>\n<h2><strong>\u521b\u5efaExecutable\u5bf9\u8c61<\/strong><\/h2>\n<p>exe = Executable(script, targetName=exe_name)<\/p>\n<h2><strong>\u8c03\u7528setup\u51fd\u6570\u8fdb\u884c\u6253\u5305<\/strong><\/h2>\n<p>setup(<\/p>\n<p>    name=exe_name,<\/p>\n<p>    version=&#39;1.0&#39;,<\/p>\n<p>    description=&#39;Description of your script&#39;,<\/p>\n<p>    options={&#39;build_exe&#39;: {&#39;packages&#39;: hiddenimports}},<\/p>\n<p>    executables=[exe]<\/p>\n<p>)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<hr>\n<h2><strong>\u4e03\u3001PY2EXE\u7b80\u4ecb<\/strong><\/h2>\n<p><p>py2exe\u662f\u4e00\u6b3e\u4e13\u95e8\u7528\u4e8e\u5c06Python\u811a\u672c\u6253\u5305\u6210Windows\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5de5\u5177\u3002\u5b83\u53ea\u652f\u6301Windows\u5e73\u53f0\uff0c\u53ef\u4ee5\u5c06Python\u811a\u672c\u53ca\u5176\u4f9d\u8d56\u9879\u6253\u5305\u6210\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u4f7f\u5f97\u7528\u6237\u53ef\u4ee5\u5728\u6ca1\u6709Python\u73af\u5883\u7684Windows\u673a\u5668\u4e0a\u8fd0\u884c\u8fd9\u4e9b\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<p><h2>1\u3001py2exe\u7684\u4f18\u70b9<\/h2>\n<\/p>\n<p><h3>a\u3001\u9488\u5bf9Windows\u4f18\u5316<\/h3>\n<\/p>\n<p><p>py2exe\u4e13\u95e8\u9488\u5bf9Windows\u5e73\u53f0\u8fdb\u884c\u4e86\u4f18\u5316\uff0c\u6253\u5305\u7684\u53ef\u6267\u884c\u6587\u4ef6\u5728Windows\u4e0a\u8fd0\u884c\u6027\u80fd\u8f83\u597d\u3002\u5bf9\u4e8e\u9700\u8981\u5728Windows\u4e0a\u5206\u53d1\u7684Python\u5e94\u7528\u7a0b\u5e8f\uff0cpy2exe\u662f\u4e00\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\u3002<\/p>\n<\/p>\n<p><h3>b\u3001\u7b80\u5355\u6613\u7528<\/h3>\n<\/p>\n<p><p>py2exe\u7684\u5b89\u88c5\u548c\u4f7f\u7528\u975e\u5e38\u7b80\u5355\u3002\u901a\u8fc7\u7b80\u5355\u7684\u914d\u7f6e\u6587\u4ef6\u548c\u547d\u4ee4\u884c\u64cd\u4f5c\uff0c\u5c31\u53ef\u4ee5\u8f7b\u677e\u5730\u5c06Python\u811a\u672c\u6253\u5305\u6210Windows\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h2>2\u3001py2exe\u7684\u7f3a\u70b9<\/h2>\n<\/p>\n<p><h3>a\u3001\u4e0d\u652f\u6301\u8de8\u5e73\u53f0<\/h3>\n<\/p>\n<p><p>py2exe\u53ea\u652f\u6301Windows\u5e73\u53f0\uff0c\u4e0d\u652f\u6301MacOS\u548cLinux\u3002\u5982\u679c\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u9700\u8981\u8de8\u5e73\u53f0\u652f\u6301\uff0c\u90a3\u4e48py2exe\u53ef\u80fd\u4e0d\u9002\u5408\u4f60\u3002<\/p>\n<\/p>\n<p><h3>b\u3001\u793e\u533a\u652f\u6301\u8f83\u5c11<\/h3>\n<\/p>\n<p><p>\u4e0ePyInstaller\u548ccx_Freeze\u76f8\u6bd4\uff0cpy2exe\u7684\u793e\u533a\u652f\u6301\u76f8\u5bf9\u8f83\u5c11\uff0c\u9047\u5230\u95ee\u9898\u65f6\u53ef\u80fd\u9700\u8981\u66f4\u591a\u7684\u65f6\u95f4\u6765\u67e5\u627e\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<\/p>\n<hr>\n<h2><strong>\u516b\u3001PY2EXE\u7684\u57fa\u672c\u4f7f\u7528<\/strong><\/h2>\n<p><h2>1\u3001\u5b89\u88c5py2exe<\/h2>\n<\/p>\n<p><p>\u5728\u4f7f\u7528py2exe\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u4f60\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u548cpip\u3002\u7136\u540e\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5py2exe\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pip install py2exe<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u9a8c\u8bc1\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">python -m py2exe --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>2\u3001\u521b\u5efasetup\u811a\u672c<\/h2>\n<\/p>\n<p><p>\u8981\u4f7f\u7528py2exe\u6253\u5305Python\u811a\u672c\uff0c\u9996\u5148\u9700\u8981\u521b\u5efa\u4e00\u4e2a<code>setup.py<\/code>\u6587\u4ef6\u6765\u914d\u7f6e\u6253\u5305\u8fc7\u7a0b\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684<code>setup.py<\/code>\u6587\u4ef6\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from distutils.core import setup<\/p>\n<p>import py2exe<\/p>\n<p>setup(<\/p>\n<p>    console=[&#39;your_script.py&#39;]<\/p>\n<p>)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>3\u3001\u8fd0\u884csetup\u811a\u672c<\/h2>\n<\/p>\n<p><p>\u521b\u5efa\u597d<code>setup.py<\/code>\u6587\u4ef6\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u8fd0\u884c\u5b83\u5e76\u8fdb\u884c\u6253\u5305\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">python setup.py py2exe<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e2a\u547d\u4ee4\u5c06\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u751f\u6210\u4e00\u4e2a<code>dist<\/code>\u6587\u4ef6\u5939\uff0c\u91cc\u9762\u5305\u542b\u4e86\u6253\u5305\u540e\u7684\u53ef\u6267\u884c\u6587\u4ef6\u53ca\u5176\u4f9d\u8d56\u9879\u3002<\/p>\n<\/p>\n<hr>\n<h2><strong>\u4e5d\u3001PY2EXE\u7684\u9ad8\u7ea7\u4f7f\u7528<\/strong><\/h2>\n<p><h2>1\u3001\u6dfb\u52a0\u6570\u636e\u6587\u4ef6<\/h2>\n<\/p>\n<p><p>\u6709\u65f6\u5019\u4f60\u7684Python\u811a\u672c\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u989d\u5916\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6bd4\u5982\u914d\u7f6e\u6587\u4ef6\u3001\u56fe\u7247\u7b49\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u5728<code>setup.py<\/code>\u6587\u4ef6\u4e2d\u7684<code>data_files<\/code>\u53c2\u6570\u4e2d\u6dfb\u52a0\u8fd9\u4e9b\u6587\u4ef6\u6765\u5c06\u5b83\u4eec\u6253\u5305\u5230\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from distutils.core import setup<\/p>\n<p>import py2exe<\/p>\n<h2><strong>\u6dfb\u52a0\u6570\u636e\u6587\u4ef6<\/strong><\/h2>\n<p>data_files = [(&#39;data&#39;, [&#39;data\/config.json&#39;])]<\/p>\n<p>setup(<\/p>\n<p>    console=[&#39;your_script.py&#39;],<\/p>\n<p>    data_files=data_files<\/p>\n<p>)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>2\u3001\u9690\u85cf\u5bfc\u5165\u6a21\u5757<\/h2>\n<\/p>\n<p><p>\u6709\u4e9b\u5e93\u53ef\u80fd\u4f1a\u52a8\u6001\u5bfc\u5165\u6a21\u5757\uff0c\u8fd9\u4e9b\u6a21\u5757\u5728\u9759\u6001\u5206\u6790\u65f6\u65e0\u6cd5\u88ab\u68c0\u6d4b\u5230\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u5728<code>setup.py<\/code>\u6587\u4ef6\u4e2d\u7684<code>options<\/code>\u53c2\u6570\u4e2d\u6dfb\u52a0\u8fd9\u4e9b\u6a21\u5757\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from distutils.core import setup<\/p>\n<p>import py2exe<\/p>\n<h2><strong>\u9690\u85cf\u5bfc\u5165\u6a21\u5757<\/strong><\/h2>\n<p>hiddenimports = [&#39;module1&#39;, &#39;module2&#39;]<\/p>\n<p>setup(<\/p>\n<p>    console=[&#39;your_script.py&#39;],<\/p>\n<p>    options={&#39;py2exe&#39;: {&#39;includes&#39;: hiddenimports}}<\/p>\n<p>)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<hr>\n<h2><strong>\u5341\u3001\u603b\u7ed3<\/strong><\/h2>\n<p><p>\u5c06Python\u811a\u672c\u6253\u5305\u6210\u53ef\u6267\u884c\u6587\u4ef6\u662f\u5206\u53d1Python\u5e94\u7528\u7a0b\u5e8f\u7684\u5e38\u89c1\u9700\u6c42\u3002\u901a\u8fc7\u4f7f\u7528PyInstaller\u3001cx_Freeze\u548cpy2exe\u7b49\u5de5\u5177\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u5c06Python\u811a\u672c\u6253\u5305\u6210\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002\u5728\u9009\u62e9\u5de5\u5177\u65f6\uff0c\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u548c\u5e73\u53f0\u8fdb\u884c\u9009\u62e9\u3002PyInstaller\u9002\u7528\u4e8e\u591a\u5e73\u53f0\uff0c\u4e14\u4f7f\u7528\u7b80\u5355\uff1bcx_Freeze\u63d0\u4f9b\u4e86\u66f4\u9ad8\u7684\u7075\u6d3b\u6027\uff1bpy2exe\u4e13\u95e8\u9488\u5bf9Windows\u5e73\u53f0\u8fdb\u884c\u4e86\u4f18\u5316\u3002\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u5de5\u5177\uff0c\u90fd\u53ef\u4ee5\u901a\u8fc7\u5408\u7406\u7684\u914d\u7f6e\u6765\u6ee1\u8db3\u6253\u5305\u9700\u6c42\uff0c\u5e76\u786e\u4fdd\u6253\u5305\u540e\u7684\u53ef\u6267\u884c\u6587\u4ef6\u80fd\u591f\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u5c06\u7a0b\u5e8f\u6253\u5305\u6210exe\u6587\u4ef6\uff1f<\/strong><br \/>\u8981\u5c06Python\u7a0b\u5e8f\u6253\u5305\u6210exe\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528\u50cfPyInstaller\u6216cx_Freeze\u7b49\u5de5\u5177\u3002PyInstaller\u662f\u6700\u53d7\u6b22\u8fce\u7684\u9009\u62e9\uff0c\u56e0\u4e3a\u5b83\u7b80\u5355\u6613\u7528\u3002\u5b89\u88c5PyInstaller\u540e\uff0c\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165<code>pyinstaller your_script.py<\/code>\uff0c\u8fd9\u5c06\u751f\u6210\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u901a\u5e38\u4f4d\u4e8e<code>dist<\/code>\u6587\u4ef6\u5939\u4e2d\u3002<\/p>\n<p><strong>\u6253\u5305exe\u6587\u4ef6\u65f6\u9700\u8981\u6ce8\u610f\u54ea\u4e9b\u4f9d\u8d56\u9879\uff1f<\/strong><br \/>\u5728\u6253\u5305\u8fc7\u7a0b\u4e2d\uff0c\u786e\u4fdd\u6240\u6709\u4f9d\u8d56\u9879\u90fd\u5df2\u6b63\u786e\u5b89\u88c5\u5e76\u5728\u4ee3\u7801\u4e2d\u5bfc\u5165\u3002PyInstaller\u901a\u5e38\u4f1a\u81ea\u52a8\u68c0\u6d4b\u4f9d\u8d56\u9879\uff0c\u4f46\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u53ef\u80fd\u9700\u8981\u624b\u52a8\u6307\u5b9a\u4e00\u4e9b\u5e93\u3002\u67e5\u9605\u76f8\u5173\u6587\u6863\u53ef\u4ee5\u5e2e\u52a9\u60a8\u4e86\u89e3\u5982\u4f55\u5904\u7406\u7279\u5b9a\u4f9d\u8d56\u5173\u7cfb\u3002<\/p>\n<p><strong>\u751f\u6210\u7684exe\u6587\u4ef6\u5728\u5176\u4ed6\u8ba1\u7b97\u673a\u4e0a\u80fd\u5426\u8fd0\u884c\uff1f<\/strong><br \/>\u662f\u7684\uff0c\u751f\u6210\u7684exe\u6587\u4ef6\u53ef\u4ee5\u5728\u6ca1\u6709Python\u73af\u5883\u7684\u8ba1\u7b97\u673a\u4e0a\u8fd0\u884c\u3002\u4e0d\u8fc7\uff0c\u4e3a\u786e\u4fdd\u517c\u5bb9\u6027\uff0c\u5efa\u8bae\u5728\u76ee\u6807\u8ba1\u7b97\u673a\u4e0a\u8fdb\u884c\u6d4b\u8bd5\u3002\u67d0\u4e9b\u7b2c\u4e09\u65b9\u5e93\u53ef\u80fd\u9700\u8981\u989d\u5916\u7684DLL\u6587\u4ef6\uff0c\u56e0\u6b64\u5728\u6253\u5305\u4e4b\u524d\uff0c\u6700\u597d\u63d0\u524d\u4e86\u89e3\u8fd9\u4e9b\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u6253\u5305exe\u6587\u4ef6\u8def\u5f84\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5e38\u89c1\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528PyInstaller\u3001cx_Freeze\u3001py [&hellip;]","protected":false},"author":3,"featured_media":1183222,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1183211"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1183211"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1183211\/revisions"}],"predecessor-version":[{"id":1183224,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1183211\/revisions\/1183224"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1183222"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1183211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1183211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1183211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}