{"id":205389,"date":"2025-05-29T13:26:56","date_gmt":"2025-05-29T05:26:56","guid":{"rendered":"https:\/\/server.hk\/cnblog\/205389\/"},"modified":"2025-05-29T13:26:56","modified_gmt":"2025-05-29T05:26:56","slug":"%e5%a6%82%e4%bd%95%e6%89%93%e5%8c%85python%e8%84%9a%e6%9c%ac%e4%bd%bf%e5%85%b6%e4%b8%8d%e5%8f%97%e7%9b%ae%e6%a0%87%e6%9c%ba%e5%99%a8python%e7%89%88%e6%9c%ac%e5%bd%b1%e5%93%8d%e5%b9%b6%e4%b8%80","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/205389\/","title":{"rendered":"\u5982\u4f55\u6253\u5305Python\u811a\u672c\u4f7f\u5176\u4e0d\u53d7\u76ee\u6807\u673a\u5668Python\u7248\u672c\u5f71\u54cd\u5e76\u4e00\u952e\u8fd0\u884c\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5982\u4f55\u6253\u5305Python\u811a\u672c\u4f7f\u5176\u4e0d\u53d7\u76ee\u6807\u673a\u5668Python\u7248\u672c\u5f71\u54cd\u5e76\u4e00\u952e\u8fd0\u884c\uff1f<\/h1>\n<p>\u5077\u5077\u52aa\u529b\uff0c\u6084\u65e0\u58f0\u606f\u5730\u53d8\u5f3a\uff0c\u7136\u540e\u60ca\u8273\u6240\u6709\u4eba\uff01\u54c8\u54c8\uff0c\u5c0f\u4f19\u4f34\u4eec\u53c8\u6765\u5b66\u4e60\u5566~\u4eca\u5929\u6211\u5c06\u7ed9\u5927\u5bb6\u4ecb\u7ecd\uff0c\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4f1a\u8bb2\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u4e0d\u77e5\u9053\u5927\u5bb6\u5bf9\u5176\u90fd\u6709\u591a\u5c11\u4e86\u89e3\uff0c\u4e0b\u9762\u6211\u4eec\u5c31\u4e00\u8d77\u6765\u770b\u4e00\u5427\uff01\u5f53\u7136\uff0c\u975e\u5e38\u5e0c\u671b\u5927\u5bb6\u80fd\u591a\u591a\u8bc4\u8bba\uff0c\u7ed9\u51fa\u5408\u7406\u7684\u5efa\u8bae\uff0c\u6211\u4eec\u4e00\u8d77\u5b66\u4e60\uff0c\u4e00\u8d77\u8fdb\u6b65\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241130\/1732965162674af32adc9ff.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>\u5982\u4f55\u5728\u4e0d\u53d7 Python \u7248\u672c\u5f71\u54cd\u4e0b\u6253\u5305\u811a\u672c\u6587\u4ef6\u5939\u5e76\u6b63\u5e38\u6267\u884c\uff1f<\/strong><\/p>\n<p>\u4e3a\u4e86\u6ee1\u8db3\u7279\u5b9a\u7248\u672c\u7684\u8f6f\u4ef6\u8981\u6c42\uff0c\u4f5c\u8005\u5e0c\u671b\u5728\u865a\u62df\u73af\u5883\u4e2d\u8fd0\u884c\u811a\u672c\uff0c\u540c\u65f6\u907f\u514d\u6bcf\u6b21\u624b\u52a8\u8fdb\u5165\u865a\u62df\u73af\u5883\u7684\u9ebb\u70e6\u3002\u672c\u6587\u4ecb\u7ecd\u4e86\u4e00\u79cd\u66ff\u4ee3\u65b9\u6848\uff0c\u5373\u4f7f\u7528\u5d4c\u5165\u7248 Python\u3002<\/p>\n<p><strong>\u6b65\u9aa4\uff1a<\/strong><\/p>\n<ol>\n<li><strong>\u4e0b\u8f7d\u5e76\u89e3\u538b\u5d4c\u5165\u7248 Python\uff1a<\/strong><br \/>\u4ece\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u7b26\u5408\u9700\u6c42\u7684 Python \u5d4c\u5165\u7248\uff0c\u4f8b\u5982 Python 3.11.6\u3002\u5c06\u5176\u89e3\u538b\u5230\u4e00\u4e2a\u76ee\u5f55\u4e0b\uff0c\u5982 D:\/yourapp\/\u3002<\/li>\n<li><strong>\u4e0b\u8f7d\u5e76\u5b89\u88c5 pip\uff1a<\/strong><br \/>\u83b7\u53d6 get-pip.py \u811a\u672c\u5e76\u5c06\u5176\u6267\u884c\uff0c\u4ee5\u5b89\u88c5 pip\u3002<\/li>\n<li><strong>\u914d\u7f6e python311._pth \u6587\u4ef6\uff1a<\/strong><br \/>\u53d6\u6d88\u6ce8\u91ca python311._pth \u6587\u4ef6\u4e2d\u7684 import site \u6ce8\u91ca\u884c\u3002<\/li>\n<li><strong>\u5b89\u88c5\u4f9d\u8d56\u5305\uff1a<\/strong><br \/>\u4f7f\u7528 pip \u5b89\u88c5\u811a\u672c\u6240\u9700\u7684\u6240\u6709\u4f9d\u8d56\u5305\u3002<\/li>\n<li><strong>\u6253\u5305\u4ee3\u7801\uff1a<\/strong><br \/>\u5c06\u4ee3\u7801\u548c\u4f9d\u8d56\u6587\u4ef6\u6253\u5305\u5230\u4e00\u4e2a\u6587\u4ef6\u5939\u4e2d\uff0c\u5982 code\/\u3002<\/li>\n<li><strong>\u521b\u5efa bat \u811a\u672c\uff1a<\/strong><br \/>\u521b\u5efa\u4e00\u4e2a bat \u811a\u672c\uff0c\u6307\u5b9a\u5d4c\u5165\u7248 Python \u8def\u5f84\u5e76\u4f20\u9012\u811a\u672c\u6587\u4ef6\u4ee5\u53ca\u53c2\u6570\u3002<\/li>\n<li><strong>\u9a8c\u8bc1\uff1a<\/strong><br \/>\u8fd0\u884c bat \u811a\u672c\u4ee5\u9a8c\u8bc1\u811a\u672c\u662f\u5426\u6b63\u5e38\u6267\u884c\u3002<\/li>\n<\/ol>\n<p>\u6253\u5305\u540e\u7684\u6587\u4ef6\u5939\u53ef\u4ee5\u590d\u5236\u5230\u5176\u4ed6\u8ba1\u7b97\u673a\u4e0a\u8fd0\u884c\uff0c\u4e0d\u53d7\u76ee\u6807\u8ba1\u7b97\u673a Python \u7248\u672c\u7684\u5f71\u54cd\u3002<\/p>\n<p>\u5230\u8fd9\u91cc\uff0c\u6211\u4eec\u4e5f\u5c31\u8bb2\u5b8c\u4e86\u300a\u5982\u4f55\u6253\u5305Python\u811a\u672c\u4f7f\u5176\u4e0d\u53d7\u76ee\u6807\u673a\u5668Python\u7248\u672c\u5f71\u54cd\u5e76\u4e00\u952e\u8fd0\u884c\uff1f\u300b\u7684\u5185\u5bb9\u4e86\u3002\u4e2a\u4eba\u8ba4\u4e3a\uff0c\u57fa\u7840\u77e5\u8bc6\u7684\u5b66\u4e60\u548c\u5de9\u56fa\uff0c\u662f\u4e3a\u4e86\u66f4\u597d\u7684\u5c06\u5176\u8fd0\u7528\u5230\u9879\u76ee\u4e2d\uff0c\u6b22\u8fce\u5173\u6ce8\u516c\u4f17\u53f7\uff0c\u5e26\u4f60\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u77e5\u8bc6\u70b9\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u6253\u5305Python\u811a\u672c\u4f7f\u5176\u4e0d\u53d7&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-205389","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/205389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=205389"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/205389\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=205389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=205389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=205389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}