{"id":51881,"date":"2024-10-08T22:15:20","date_gmt":"2024-10-08T14:15:20","guid":{"rendered":"https:\/\/server.hk\/cnblog\/51881\/"},"modified":"2024-11-14T10:41:22","modified_gmt":"2024-11-14T02:41:22","slug":"ubuntu-20-04-lts-%e5%b0%87%e8%87%b4%e5%8a%9b%e6%96%bc%e7%a7%bb%e9%99%a4-python-2-%e7%9a%84%e5%b7%a5%e4%bd%9c","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/51881\/","title":{"rendered":"Ubuntu 20.04 LTS \u5c07\u81f4\u529b\u65bc\u79fb\u9664 Python 2 \u7684\u5de5\u4f5c"},"content":{"rendered":"<h1 id=\"ubuntu-20-04-lts-%e5%b0%87%e8%87%b4%e5%8a%9b%e6%96%bc%e7%a7%bb%e9%99%a4-python-2-%e7%9a%84%e5%b7%a5%e4%bd%9c-AGxIyFuTqf\">Ubuntu 20.04 LTS \u5c07\u81f4\u529b\u65bc\u79fb\u9664 Python 2 \u7684\u5de5\u4f5c<\/h1>\n<p>\u5728\u958b\u6e90\u793e\u7fa4\u4e2d\uff0cPython \u662f\u4e00\u7a2e\u5ee3\u6cdb\u4f7f\u7528\u7684\u7a0b\u5f0f\u8a9e\u8a00\uff0c\u56e0\u5176\u7c21\u6f54\u7684\u8a9e\u6cd5\u548c\u5f37\u5927\u7684\u529f\u80fd\u800c\u53d7\u5230\u958b\u767c\u8005\u7684\u9752\u775e\u3002\u7136\u800c\uff0c\u96a8\u8457\u6280\u8853\u7684\u9032\u6b65\uff0cPython 2 \u7684\u4f7f\u7528\u9010\u6f38\u88ab Python 3 \u6240\u53d6\u4ee3\u3002Ubuntu 20.04 LTS \u7684\u63a8\u51fa\u6a19\u8a8c\u8457\u9019\u4e00\u8f49\u8b8a\u7684\u9032\u4e00\u6b65\u6df1\u5316\uff0c\u7279\u5225\u662f\u5728\u79fb\u9664 Python 2 \u7684\u5de5\u4f5c\u4e0a\u3002<\/p>\n<h2 id=\"python-2-%e7%9a%84%e6%ad%b7%e5%8f%b2%e8%88%87%e7%8f%be%e7%8b%80-AGxIyFuTqf\">Python 2 \u7684\u6b77\u53f2\u8207\u73fe\u72c0<\/h2>\n<p>Python 2 \u65bc 2000 \u5e74\u9996\u6b21\u767c\u5e03\uff0c\u4e26\u5728\u96a8\u5f8c\u7684\u5e7e\u5e74\u4e2d\u8fc5\u901f\u7372\u5f97\u4e86\u5ee3\u6cdb\u7684\u61c9\u7528\u3002\u7136\u800c\uff0c\u96a8\u8457 Python 3 \u7684\u63a8\u51fa\uff0cPython 2 \u7684\u652f\u6301\u9010\u6f38\u6e1b\u5c11\u3002Python \u5b98\u65b9\u65bc 2020 \u5e74 1 \u6708 1 \u65e5\u6b63\u5f0f\u505c\u6b62\u5c0d Python 2 \u7684\u652f\u6301\uff0c\u9019\u610f\u5473\u8457\u4e0d\u518d\u63d0\u4f9b\u4efb\u4f55\u5b89\u5168\u66f4\u65b0\u6216\u4fee\u5fa9\u3002<\/p>\n<h2 id=\"ubuntu-20-04-lts-%e7%9a%84%e8%ae%8a%e5%8c%96-AGxIyFuTqf\">Ubuntu 20.04 LTS \u7684\u8b8a\u5316<\/h2>\n<p>Ubuntu 20.04 LTS\uff08Focal Fossa\uff09\u662f Canonical \u516c\u53f8\u65bc 2020 \u5e74\u767c\u5e03\u7684\u9577\u671f\u652f\u6301\u7248\u672c\u3002\u9019\u4e00\u7248\u672c\u7684\u4e3b\u8981\u7279\u9ede\u4e4b\u4e00\u662f\u5c07\u91cd\u5fc3\u653e\u5728 Python 3 \u4e0a\uff0c\u4e26\u8a08\u5283\u9010\u6b65\u79fb\u9664 Python 2 \u7684\u76f8\u95dc\u652f\u6301\u3002\u9019\u4e00\u6c7a\u7b56\u53cd\u6620\u4e86\u958b\u767c\u8005\u793e\u7fa4\u5c0d\u65bc\u4f7f\u7528\u6700\u65b0\u6280\u8853\u7684\u9700\u6c42\uff0c\u4ee5\u53ca\u5c0d\u65bc\u5b89\u5168\u6027\u548c\u6027\u80fd\u7684\u91cd\u8996\u3002<\/p>\n<h3 id=\"%e7%a7%bb%e9%99%a4-python-2-%e7%9a%84%e5%bd%b1%e9%9f%bf-AGxIyFuTqf\">\u79fb\u9664 Python 2 \u7684\u5f71\u97ff<\/h3>\n<p>\u79fb\u9664 Python 2 \u5c0d\u65bc\u8a31\u591a\u4f9d\u8cf4\u65bc\u8a72\u8a9e\u8a00\u7684\u61c9\u7528\u7a0b\u5f0f\u548c\u5eab\u4f86\u8aaa\uff0c\u5c07\u6703\u662f\u4e00\u500b\u6311\u6230\u3002\u8a31\u591a\u820a\u7248\u7684\u61c9\u7528\u7a0b\u5f0f\u4ecd\u7136\u4f7f\u7528 Python 2\uff0c\u9019\u610f\u5473\u8457\u958b\u767c\u8005\u9700\u8981\u82b1\u8cbb\u6642\u9593\u548c\u7cbe\u529b\u5c07\u5176\u8f49\u63db\u70ba Python 3\u3002\u9019\u4e00\u904e\u7a0b\u53ef\u80fd\u6d89\u53ca\u5230\u4ee3\u78bc\u7684\u91cd\u5beb\u548c\u6e2c\u8a66\uff0c\u5c0d\u65bc\u4e00\u4e9b\u5927\u578b\u9805\u76ee\u4f86\u8aaa\uff0c\u9019\u662f\u4e00\u9805\u4e0d\u5c0f\u7684\u5de5\u4f5c\u3002<\/p>\n<h4 id=\"%e8%bd%89%e6%8f%9b%e7%9a%84%e5%bf%85%e8%a6%81%e6%80%a7-AGxIyFuTqf\">\u8f49\u63db\u7684\u5fc5\u8981\u6027<\/h4>\n<p>\u8f49\u63db\u5230 Python 3 \u4e0d\u50c5\u662f\u70ba\u4e86\u9069\u61c9\u65b0\u7684\u74b0\u5883\uff0c\u9084\u662f\u70ba\u4e86\u7372\u5f97\u66f4\u597d\u7684\u6027\u80fd\u548c\u5b89\u5168\u6027\u3002Python 3 \u5f15\u5165\u4e86\u8a31\u591a\u65b0\u7279\u6027\uff0c\u4f8b\u5982\u66f4\u597d\u7684 Unicode \u652f\u6301\u3001\u7570\u6b65\u7de8\u7a0b\u7684\u6539\u9032\u4ee5\u53ca\u66f4\u9ad8\u6548\u7684\u6a19\u6e96\u5eab\u3002\u9019\u4e9b\u7279\u6027\u4f7f\u5f97\u958b\u767c\u8005\u80fd\u5920\u7de8\u5beb\u51fa\u66f4\u9ad8\u6548\u548c\u5b89\u5168\u7684\u4ee3\u78bc\u3002<\/p>\n<h2 id=\"%e5%a6%82%e4%bd%95%e9%80%b2%e8%a1%8c%e8%bd%89%e6%8f%9b-AGxIyFuTqf\">\u5982\u4f55\u9032\u884c\u8f49\u63db<\/h2>\n<p>\u5c0d\u65bc\u5e0c\u671b\u5c07\u61c9\u7528\u7a0b\u5f0f\u5f9e Python 2 \u8f49\u63db\u5230 Python 3 \u7684\u958b\u767c\u8005\u4f86\u8aaa\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5efa\u8b70\uff1a<\/p>\n<ul>\n<li><strong>\u4f7f\u75282to3\u5de5\u5177\uff1a<\/strong>\u9019\u662f\u4e00\u500b\u81ea\u52d5\u5316\u5de5\u5177\uff0c\u53ef\u4ee5\u5e6b\u52a9\u958b\u767c\u8005\u5c07 Python 2 \u7684\u4ee3\u78bc\u8f49\u63db\u70ba Python 3\u3002<\/li>\n<li><strong>\u6e2c\u8a66\u4ee3\u78bc\uff1a<\/strong>\u5728\u8f49\u63db\u904e\u7a0b\u4e2d\uff0c\u52d9\u5fc5\u9032\u884c\u5145\u5206\u7684\u6e2c\u8a66\uff0c\u4ee5\u78ba\u4fdd\u4ee3\u78bc\u5728\u65b0\u74b0\u5883\u4e2d\u6b63\u5e38\u904b\u884c\u3002<\/li>\n<li><strong>\u53c3\u8003\u6587\u6a94\uff1a<\/strong>\u67e5\u95b1\u5b98\u65b9\u6587\u6a94\u548c\u793e\u7fa4\u8cc7\u6e90\uff0c\u4ee5\u7372\u53d6\u8f49\u63db\u904e\u7a0b\u4e2d\u7684\u5e6b\u52a9\u548c\u6307\u5c0e\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b5%90%e8%ab%96-AGxIyFuTqf\">\u7d50\u8ad6<\/h2>\n<p>Ubuntu 20.04 LTS \u5c07\u81f4\u529b\u65bc\u79fb\u9664 Python 2 \u7684\u5de5\u4f5c\uff0c\u9019\u4e00\u6c7a\u7b56\u4e0d\u50c5\u662f\u5c0d\u6280\u8853\u9032\u6b65\u7684\u97ff\u61c9\uff0c\u4e5f\u662f\u5c0d\u958b\u767c\u8005\u793e\u7fa4\u9700\u6c42\u7684\u6eff\u8db3\u3002\u96a8\u8457 Python 2 \u7684\u9010\u6b65\u6dd8\u6c70\uff0c\u958b\u767c\u8005\u9700\u8981\u7a4d\u6975\u9069\u61c9\u9019\u4e00\u8b8a\u5316\uff0c\u5c07\u61c9\u7528\u7a0b\u5f0f\u8f49\u63db\u70ba Python 3\uff0c\u4ee5\u78ba\u4fdd\u5176\u5b89\u5168\u6027\u548c\u6027\u80fd\u3002<\/p>\n<p>\u5c0d\u65bc\u9700\u8981\u7a69\u5b9a\u548c\u9ad8\u6548\u7684\u4f3a\u670d\u5668\u89e3\u6c7a\u65b9\u6848\u7684\u7528\u6236\uff0c<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u63d0\u4f9b\u4e86\u591a\u7a2e\u9078\u64c7\uff0c\u5e6b\u52a9\u958b\u767c\u8005\u5728\u65b0\u7684\u74b0\u5883\u4e2d\u9806\u5229\u904b\u884c\u5176\u61c9\u7528\u7a0b\u5f0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu 20.04 LTS focuses on removing Python 2 support, ensuring a more secure and efficient environment for developers and users alike.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-51881","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51881","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=51881"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51881\/revisions"}],"predecessor-version":[{"id":51882,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51881\/revisions\/51882"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=51881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=51881"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=51881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}