{"id":997166,"date":"2024-12-27T09:21:38","date_gmt":"2024-12-27T01:21:38","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/997166.html"},"modified":"2024-12-27T09:21:40","modified_gmt":"2024-12-27T01:21:40","slug":"python%e5%ae%89%e8%a3%85%e5%a6%82%e4%bd%95%e6%94%b9%e5%9c%b0%e5%9d%80","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/997166.html","title":{"rendered":"python\u5b89\u88c5\u5982\u4f55\u6539\u5730\u5740"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25073104\/9baec336-f6e6-49d4-bf79-b93ae0bbe2e4.webp\" alt=\"python\u5b89\u88c5\u5982\u4f55\u6539\u5730\u5740\" \/><\/p>\n<p><p> <strong>\u5728Python\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u66f4\u6539\u5730\u5740\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528Python\u5b98\u7f51\u7684\u5b89\u88c5\u5305\u3001\u901a\u8fc7\u547d\u4ee4\u884c\u53c2\u6570\u6307\u5b9a\u5b89\u88c5\u8def\u5f84\u3001\u4fee\u6539\u73af\u5883\u53d8\u91cf\u3002\u4ee5\u4e0b\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u901a\u8fc7\u547d\u4ee4\u884c\u53c2\u6570\u6307\u5b9a\u5b89\u88c5\u8def\u5f84\u7684\u8fc7\u7a0b\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u4e00\u3001\u901a\u8fc7Python\u5b98\u7f51\u7684\u5b89\u88c5\u5305<\/p>\n<\/p>\n<p><p>Python\u7684\u5b98\u65b9\u7f51\u7ad9\u63d0\u4f9b\u4e86\u591a\u79cd\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\uff0c\u7528\u6237\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e0b\u8f7d\u76f8\u5e94\u7684\u5b89\u88c5\u5305\u3002\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u7528\u6237\u53ef\u4ee5\u9009\u62e9\u81ea\u5b9a\u4e49\u5b89\u88c5\u8def\u5f84\u3002\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u53cc\u51fb\u5b89\u88c5\u5305\uff0c\u5728\u5b89\u88c5\u5411\u5bfc\u4e2d\u9009\u62e9\u201cCustomize installation\u201d\uff0c\u7136\u540e\u9009\u62e9\u201cInstall location\u201d\u6765\u6307\u5b9aPython\u7684\u5b89\u88c5\u8def\u5f84\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u662f\u6bd4\u8f83\u76f4\u89c2\u7684\uff0c\u9002\u5408\u5927\u591a\u6570\u7528\u6237\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u53c2\u6570\u6307\u5b9a\u5b89\u88c5\u8def\u5f84<\/p>\n<\/p>\n<p><p>\u5728\u547d\u4ee4\u884c\u4e2d\u5b89\u88c5Python\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u884c\u53c2\u6570\u6765\u6307\u5b9a\u5b89\u88c5\u8def\u5f84\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u4e0b\u8f7dPython\u5b89\u88c5\u5305\uff1a\u9996\u5148\uff0c\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff0c\u4e0b\u8f7d\u9002\u5408\u4f60\u64cd\u4f5c\u7cfb\u7edf\u7684Python\u5b89\u88c5\u5305\uff08\u901a\u5e38\u662f.exe\u6216.msi\u6587\u4ef6\uff09\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff1a\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u6309\u4e0bWin + R\u952e\u6253\u5f00\u201c\u8fd0\u884c\u201d\u7a97\u53e3\uff0c\u7136\u540e\u8f93\u5165cmd\u5e76\u6309Enter\u952e\u6765\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u547d\u4ee4\u884c\u53c2\u6570\u5b89\u88c5\uff1a\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\uff0c\u5bfc\u822a\u5230\u4e0b\u8f7d\u7684Python\u5b89\u88c5\u5305\u6240\u5728\u7684\u76ee\u5f55\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5Python\uff0c\u5e76\u6307\u5b9a\u5b89\u88c5\u8def\u5f84\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">python-3.x.x.exe \/quiet InstallAllUsers=1 PrependPath=1 TargetDir=&quot;C:\\Your\\Desired\\Path&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u91cc\uff0c<code>python-3.x.x.exe<\/code>\u662f\u4f60\u4e0b\u8f7d\u7684Python\u5b89\u88c5\u5305\u7684\u540d\u79f0\uff0c<code>C:\\Your\\Desired\\Path<\/code>\u662f\u4f60\u5e0c\u671b\u5b89\u88c5Python\u7684\u76ee\u6807\u8def\u5f84\u3002\u6b64\u547d\u4ee4\u4f1a\u9759\u9ed8\u5b89\u88c5Python\uff0c\u5e76\u5c06\u5176\u6dfb\u52a0\u5230\u7cfb\u7edf\u8def\u5f84\u4e2d\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u5728\u5b89\u88c5Python\u65f6\u6307\u5b9a\u81ea\u5b9a\u4e49\u7684\u5b89\u88c5\u8def\u5f84\u3002\u8fd9\u6837\u505a\u7684\u597d\u5904\u662f\u53ef\u4ee5\u907f\u514d\u4e0e\u7cfb\u7edf\u5df2\u6709\u7684Python\u7248\u672c\u4ea7\u751f\u51b2\u7a81\uff0c\u5e76\u4e14\u65b9\u4fbf\u5728\u591a\u7248\u672c\u73af\u5883\u4e2d\u8fdb\u884c\u7ba1\u7406\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u4fee\u6539\u73af\u5883\u53d8\u91cf<\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u80fd\u8fd8\u9700\u8981\u4fee\u6539\u73af\u5883\u53d8\u91cf\u4ee5\u786e\u4fdd\u7cfb\u7edf\u80fd\u591f\u6b63\u786e\u8bc6\u522b\u548c\u4f7f\u7528\u65b0\u5b89\u88c5\u7684Python\u7248\u672c\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u6253\u5f00\u7cfb\u7edf\u5c5e\u6027\uff1a\u53f3\u952e\u70b9\u51fb\u201c\u6b64\u7535\u8111\u201d\u6216\u201c\u6211\u7684\u7535\u8111\u201d\uff0c\u9009\u62e9\u201c\u5c5e\u6027\u201d\uff0c\u7136\u540e\u70b9\u51fb\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u6253\u5f00\u73af\u5883\u53d8\u91cf\uff1a\u5728\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\u7a97\u53e3\u4e2d\uff0c\u70b9\u51fb\u201c\u73af\u5883\u53d8\u91cf\u201d\u6309\u94ae\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u4fee\u6539PATH\u53d8\u91cf\uff1a\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u90e8\u5206\uff0c\u627e\u5230\u201cPath\u201d\u53d8\u91cf\u5e76\u9009\u4e2d\uff0c\u70b9\u51fb\u201c\u7f16\u8f91\u201d\u6309\u94ae\u3002\u5728\u5f39\u51fa\u7684\u7a97\u53e3\u4e2d\uff0c\u6dfb\u52a0\u65b0\u5b89\u88c5\u7684Python\u8def\u5f84\uff0c\u4f8b\u5982<code>C:\\Your\\Desired\\Path\\Scripts<\/code>\u548c<code>C:\\Your\\Desired\\Path\\<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u4fdd\u5b58\u66f4\u6539\uff1a\u70b9\u51fb\u201c\u786e\u5b9a\u201d\u6309\u94ae\u4fdd\u5b58\u66f4\u6539\uff0c\u5e76\u5173\u95ed\u6240\u6709\u7a97\u53e3\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4fee\u6539\u73af\u5883\u53d8\u91cf\uff0c\u786e\u4fdd\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528Python\u547d\u4ee4\uff0c\u800c\u4e0d\u9700\u8981\u6307\u5b9a\u5b8c\u6574\u8def\u5f84\u3002<\/p>\n<\/p>\n<p><p>\u603b\u7ed3\uff0c\u901a\u8fc7\u4ee5\u4e0a\u51e0\u4e2a\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u5728\u5b89\u88c5Python\u65f6\u66f4\u6539\u5b89\u88c5\u5730\u5740\uff0c\u5e76\u786e\u4fdd\u7cfb\u7edf\u80fd\u591f\u6b63\u786e\u8bc6\u522b\u548c\u4f7f\u7528Python\u3002\u8fd9\u6837\u505a\u4e0d\u4ec5\u53ef\u4ee5\u907f\u514d\u4e0e\u5176\u4ed6Python\u7248\u672c\u51b2\u7a81\uff0c\u8fd8\u80fd\u6839\u636e\u9700\u8981\u7075\u6d3b\u7ba1\u7406\u548c\u5207\u6362\u4e0d\u540c\u7684Python\u73af\u5883\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Windows\u4e0a\u66f4\u6539Python\u7684\u5b89\u88c5\u8def\u5f84\uff1f<\/strong><br \/>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u5728\u5b89\u88c5Python\u65f6\u9009\u62e9\u201cCustomize installation\u201d\u9009\u9879\u6765\u66f4\u6539\u9ed8\u8ba4\u7684\u5b89\u88c5\u8def\u5f84\u3002\u4e4b\u540e\uff0c\u60a8\u53ef\u4ee5\u624b\u52a8\u6307\u5b9a\u4e00\u4e2a\u65b0\u7684\u6587\u4ef6\u5939\u6765\u5b89\u88c5Python\u3002\u786e\u4fdd\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u52fe\u9009\u201cAdd Python to PATH\u201d\u4ee5\u4fbf\u4e8e\u540e\u7eed\u7684\u4f7f\u7528\u3002<\/p>\n<p><strong>\u5728Linux\u6216Mac\u4e0a\uff0c\u5982\u4f55\u5b89\u88c5Python\u5230\u81ea\u5b9a\u4e49\u76ee\u5f55\uff1f<\/strong><br \/>\u5728Linux\u6216Mac\u7cfb\u7edf\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u6e90\u4ee3\u7801\u7f16\u8bd1\u5b89\u88c5Python\u3002\u5728\u7ec8\u7aef\u4e2d\u4e0b\u8f7d\u6e90\u4ee3\u7801\u540e\uff0c\u4f7f\u7528<code>.\/configure --prefix=\/\u81ea\u5b9a\u4e49\u8def\u5f84<\/code>\u547d\u4ee4\u6307\u5b9a\u5b89\u88c5\u76ee\u5f55\u3002\u63a5\u7740\uff0c\u6267\u884c<code>make<\/code>\u548c<code>make install<\/code>\u547d\u4ee4\uff0cPython\u5c06\u4f1a\u88ab\u5b89\u88c5\u5230\u60a8\u6307\u5b9a\u7684\u8def\u5f84\u3002<\/p>\n<p><strong>\u5982\u679c\u6211\u5df2\u7ecf\u5b89\u88c5\u4e86Python\uff0c\u5982\u4f55\u66f4\u6539\u73b0\u6709\u7684\u5b89\u88c5\u5730\u5740\uff1f<\/strong><br \/>\u5982\u679c\u60a8\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u5e76\u60f3\u8981\u66f4\u6539\u5176\u5b89\u88c5\u5730\u5740\uff0c\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u5378\u8f7d\u5f53\u524d\u7248\u672c\u5e76\u5728\u65b0\u8def\u5f84\u4e0b\u91cd\u65b0\u5b89\u88c5\u3002\u786e\u4fdd\u5728\u5378\u8f7d\u4e4b\u524d\u5907\u4efd\u91cd\u8981\u7684\u9879\u76ee\u548c\u865a\u62df\u73af\u5883\u3002\u6b64\u5916\uff0c\u60a8\u4e5f\u9700\u8981\u66f4\u65b0\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\uff0c\u4ee5\u786e\u4fdd\u65b0\u7684\u8def\u5f84\u88ab\u6b63\u786e\u8bc6\u522b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u66f4\u6539\u5730\u5740\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528Python\u5b98\u7f51\u7684\u5b89\u88c5\u5305\u3001\u901a\u8fc7\u547d\u4ee4\u884c\u53c2\u6570\u6307\u5b9a\u5b89\u88c5\u8def\u5f84\u3001\u4fee\u6539\u73af\u5883 [&hellip;]","protected":false},"author":3,"featured_media":997176,"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\/997166"}],"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=997166"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/997166\/revisions"}],"predecessor-version":[{"id":997179,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/997166\/revisions\/997179"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/997176"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=997166"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=997166"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=997166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}