{"id":174949,"date":"2024-05-08T18:41:08","date_gmt":"2024-05-08T10:41:08","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/174949.html"},"modified":"2024-05-08T18:41:13","modified_gmt":"2024-05-08T10:41:13","slug":"%e5%a6%82%e4%bd%95%e4%bb%8epython-3-4-%e5%8d%87%e7%ba%a7%e5%88%b0-python-3-5","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/174949.html","title":{"rendered":"\u5982\u4f55\u4ecePython 3.4 \u5347\u7ea7\u5230 Python 3.5"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/27052705\/06c833f5-4147-4b5d-acc1-531894e8a527.webp\" alt=\"\u5982\u4f55\u4ecePython 3.4 \u5347\u7ea7\u5230 Python 3.5\" \/><\/p>\n<p><p>\u4ecePython 3.4 \u5347\u7ea7\u5230 Python 3.5\uff0c\u4e3b\u8981\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u51e0\u70b9\uff1a<strong>\u5907\u4efd\u5f53\u524d\u73af\u5883<\/strong>\u3001<strong>\u4e0b\u8f7d\u5e76\u5b89\u88c5Python 3.5<\/strong>\u3001<strong>\u9a8c\u8bc1\u5347\u7ea7<\/strong>\u3001<strong>\u8fc1\u79fb\u9879\u76ee\u4f9d\u8d56<\/strong>\u3002\u8fd9\u4e9b\u6b65\u9aa4\u65e8\u5728\u786e\u4fdd\u4e00\u4e2a\u5e73\u6ed1\u4e14\u65e0\u98ce\u9669\u7684\u5347\u7ea7\u8fc7\u7a0b\u3002\u5907\u4efd\u5f53\u524d\u73af\u5883\u5c24\u4e3a\u91cd\u8981\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u9632\u6b62\u5728\u5347\u7ea7\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u53d1\u751f\u7684\u4efb\u4f55\u6570\u636e\u4e22\u5931\u6216\u914d\u7f6e\u9519\u8bef\uff0c\u4fdd\u969c\u5f00\u53d1\u8005\u5df2\u6709\u9879\u76ee\u7684\u5b89\u5168\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u5907\u4efd\u5f53\u524d\u73af\u5883<\/h3>\n<\/p>\n<p><p>\u5728\u8fdb\u884c\u4efb\u4f55\u5347\u7ea7\u4e4b\u524d\uff0c\u5907\u4efd\u73b0\u6709\u7684Python\u73af\u5883\u53ca\u5176\u6240\u6709\u4f9d\u8d56\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u8fd9\u5305\u62ec\u4f7f\u7528\u8bf8\u5982pip freeze\u7b49\u5de5\u5177\u5bfc\u51fa\u5f53\u524d\u7684\u5e93\u7248\u672c\u5217\u8868\uff0c\u4ee5\u53ca\u590d\u5236\u73b0\u6709\u9879\u76ee\u7684\u6587\u4ef6\u548c\u8bbe\u7f6e\u3002\u8fd9\u4e00\u6b65\u7684\u76ee\u7684\u662f\u4e3a\u4e86\u4fdd\u8bc1\u5982\u679c\u65b0\u7248\u672c\u7684Python\u4e0e\u73b0\u6709\u9879\u76ee\u4e0d\u517c\u5bb9\u6216\u8005\u5b58\u5728\u4efb\u4f55\u95ee\u9898\uff0c\u53ef\u4ee5\u5feb\u901f\u56de\u6eda\u5230\u539f\u6765\u7684\u72b6\u6001\u3002<\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u4f7f\u7528\u547d\u4ee4<code>pip freeze &gt; requirements.txt<\/code>\u5c06\u5f53\u524d\u73af\u5883\u4e0b\u6240\u6709\u5e93\u7684\u7248\u672c\u5bfc\u51fa\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\u3002\u8fd9\u6837\u505a\u53ef\u4ee5\u8ba9\u4f60\u5728\u5b89\u88c5Python 3.5\u540e\uff0c\u5feb\u901f\u6062\u590d\u539f\u6709\u73af\u5883\u7684\u6240\u6709\u4f9d\u8d56\u5e93\u3002\u63a5\u7740\uff0c\u786e\u4fdd\u628a\u9879\u76ee\u6587\u4ef6\u548c\u914d\u7f6e\u5907\u4efd\u5230\u53e6\u4e00\u4e2a\u5b89\u5168\u7684\u5730\u65b9\uff0c\u8fd9\u53ef\u80fd\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\u4f7f\u7528\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u5982Git\u8fdb\u884c\u5907\u4efd\uff0c\u6216\u662f\u7b80\u5355\u5730\u590d\u5236\u5230\u5916\u90e8\u5b58\u50a8\u8bbe\u5907\u4e2d\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4e0b\u8f7d\u5e76\u5b89\u88c5Python 3.5<\/h3>\n<\/p>\n<p><p>\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7dPython 3.5\u7684\u5b89\u88c5\u5305\u3002\u9009\u62e9\u9002\u5408\u4f60\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\u8fdb\u884c\u4e0b\u8f7d\uff0c\u65e0\u8bba\u662fWindows\u3001Linux\u8fd8\u662fMacOS\uff0c\u5b98\u65b9\u7f51\u7ad9\u90fd\u63d0\u4f9b\u4e86\u8be6\u7ec6\u7684\u5b89\u88c5\u6307\u5357\u3002\u5728\u5b89\u88c5Python 3.5\u4e4b\u524d\uff0c\u8981\u786e\u4fdd\u5df2\u7ecf\u4ece\u7cfb\u7edf\u4e2d\u5378\u8f7d\u4e86Python 3.4\uff0c\u907f\u514d\u7248\u672c\u51b2\u7a81\u3002<\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u8bb0\u5f97\u9009\u4e2d\u201cAdd Python 3.5 to PATH\u201d\u7684\u9009\u9879\uff0c\u8fd9\u6837\u53ef\u4ee5\u65b9\u4fbf\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u4f7f\u7528python\u547d\u4ee4\u542f\u52a8Python 3.5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f7f\u7528<code>python --version<\/code>\u6216<code>python3 --version<\/code>\u547d\u4ee4\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u9a8c\u8bc1\u5347\u7ea7<\/h3>\n<\/p>\n<p><p>\u5347\u7ea7\u5230Python 3.5\u540e\uff0c\u9996\u5148\u8981\u505a\u7684\u662f\u9a8c\u8bc1\u65b0\u5b89\u88c5\u7684Python\u7248\u672c\u662f\u5426\u80fd\u6b63\u786e\u8fd0\u4f5c\u3002\u8fd9\u5305\u62ec\u8fd0\u884c\u7b80\u5355\u7684\u6253\u5370\u547d\u4ee4\uff0c\u6bd4\u5982<code>print(&quot;Hello, Python 3.5!&quot;)<\/code>\uff0c\u4ee5\u53ca\u4f7f\u7528\u4e4b\u524d\u5907\u4efd\u7684<code>requirements.txt<\/code>\u6587\u4ef6\u6765\u6062\u590d\u5b89\u88c5\u6240\u6709\u4f9d\u8d56\u5e93\u3002<\/p>\n<\/p>\n<p><p>\u5982\u679c\u9047\u5230\u517c\u5bb9\u6027\u95ee\u9898\u6216\u5176\u4ed6\u9519\u8bef\uff0c\u4e0d\u8981\u5fd8\u8bb0\u5229\u7528\u5907\u4efd\u7684\u73af\u5883\u4fe1\u606f\u5c1d\u8bd5\u89e3\u51b3\u95ee\u9898\u3002\u53ef\u901a\u8fc7\u5728\u7ebf\u641c\u7d22\u9519\u8bef\u4fe1\u606f\uff0c\u6216\u67e5\u9605Python 3.5\u7684\u5b98\u65b9\u6587\u6863\uff0c\u627e\u5230\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u8fc1\u79fb\u9879\u76ee\u4f9d\u8d56<\/h3>\n<\/p>\n<p><p>\u6700\u540e\u4e00\u6b65\u662f\u5c06\u6240\u6709\u9879\u76ee\u4f9d\u8d56\u6210\u529f\u8fc1\u79fb\u5230Python 3.5\u3002\u8fd9\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u624b\u52a8\u8c03\u6574\uff0c\u5c24\u5176\u662f\u5bf9\u4e8e\u90a3\u4e9b\u5728Python 3.4\u548c3.5\u4e4b\u95f4\u6709\u8f83\u5927\u53d8\u52a8\u7684\u5e93\u3002\u4f7f\u7528<code>pip install -r requirements.txt<\/code>\u547d\u4ee4\u5c1d\u8bd5\u5b89\u88c5\u6240\u6709\u4f9d\u8d56\u3002<\/p>\n<\/p>\n<p><p>\u5bf9\u4e8e\u5b89\u88c5\u5931\u8d25\u7684\u5e93\uff0c\u53ef\u80fd\u9700\u8981\u67e5\u9605\u8be5\u5e93\u7684\u5b98\u65b9\u6587\u6863\uff0c\u4e86\u89e3\u662f\u5426\u9700\u8981\u7279\u5b9a\u7248\u672c\u624d\u80fd\u652f\u6301Python 3.5\uff0c\u6216\u8005\u662f\u5426\u6709\u5df2\u77e5\u7684\u517c\u5bb9\u6027\u95ee\u9898\u3002\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u5e93\u7684\u7ef4\u62a4\u8005\u4f1a\u53d1\u5e03\u65b0\u7248\u672c\u6765\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\uff0c\u56e0\u6b64\u786e\u4fdd\u4f9d\u8d56\u5e93\u662f\u6700\u65b0\u7248\u672c\u5f88\u5173\u952e\u3002<\/p>\n<\/p>\n<p><p><strong>\u603b\u7ed3\u800c\u8a00<\/strong>\uff0c\u4ecePython 3.4\u5347\u7ea7\u5230Python 3.5\u867d\u7136\u662f\u4e00\u4e2a\u76f8\u5bf9\u76f4\u63a5\u7684\u8fc7\u7a0b\uff0c\u4f46\u4ecd\u8981\u6ce8\u610f\u5907\u4efd\u3001\u9a8c\u8bc1\u548c\u7ec6\u5fc3\u5904\u7406\u4f9d\u8d56\u95ee\u9898\u3002\u901a\u8fc7\u9075\u5faa\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u53ef\u4ee5\u5c3d\u91cf\u51cf\u5c0f\u5347\u7ea7\u8fc7\u7a0b\u4e2d\u7684\u98ce\u9669\uff0c\u786e\u4fdd\u4e00\u4e2a\u987a\u7545\u7684\u8fc7\u6e21\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>Q: \u6709\u6ca1\u6709\u529e\u6cd5\u5c06Python\u7248\u672c\u4ece3.4\u5347\u7ea7\u52303.5\uff1f<\/strong><br \/>\nA: \u662f\u7684\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5c06Python\u7248\u672c\u4ece3.4\u5347\u7ea7\u52303.5\u3002 \u9996\u5148\uff0c\u60a8\u9700\u8981\u4e0b\u8f7dPython 3.5\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002\u7136\u540e\uff0c\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u5e76\u6309\u7167\u5c4f\u5e55\u4e0a\u7684\u63d0\u793a\u8fdb\u884c\u64cd\u4f5c\u3002\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u60a8\u53ef\u4ee5\u9009\u62e9\u8986\u76d6\u5f53\u524d\u7684Python\u5b89\u88c5\u8fd8\u662f\u5c06\u65b0\u7248\u672c\u5b89\u88c5\u5230\u4e0d\u540c\u7684\u76ee\u5f55\u4e2d\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u73b0\u5728\u53ef\u4ee5\u4f7f\u7528Python 3.5\u4e86\u3002<\/p>\n<p><strong>Q: \u5347\u7ea7\u5230Python 3.5\u4f1a\u5bf9\u73b0\u6709\u7684\u4ee3\u7801\u6709\u4ec0\u4e48\u5f71\u54cd\u5417\uff1f<\/strong><br \/>\nA: \u5347\u7ea7\u5230Python 3.5\u53ef\u80fd\u4f1a\u5bf9\u73b0\u6709\u7684\u4ee3\u7801\u6709\u4e00\u4e9b\u5f71\u54cd\u3002 Python 3.5\u5f15\u5165\u4e86\u4e00\u4e9b\u65b0\u7684\u529f\u80fd\u548c\u8bed\u6cd5\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u67d0\u4e9b\u4ee3\u7801\u5728\u65b0\u7248\u672c\u4e2d\u4e0d\u517c\u5bb9\u3002\u4f8b\u5982\uff0c\u4e00\u4e9b\u65b0\u7684\u6807\u51c6\u5e93\u51fd\u6570\u53ef\u80fd\u5728\u65e7\u7248\u672c\u4e2d\u4e0d\u53ef\u7528\uff0c\u6216\u8005\u67d0\u4e9b\u8bed\u6cd5\u5728\u65b0\u7248\u672c\u4e2d\u5df2\u66f4\u6539\u3002\u56e0\u6b64\uff0c\u5728\u5347\u7ea7\u4e4b\u524d\uff0c\u5efa\u8bae\u60a8\u6d4b\u8bd5\u73b0\u6709\u4ee3\u7801\u4ee5\u786e\u4fdd\u5176\u5728\u65b0\u7248\u672c\u4e2d\u4ecd\u7136\u6b63\u5e38\u5de5\u4f5c\uff0c\u5e76\u6839\u636e\u9700\u8981\u8fdb\u884c\u4fee\u6539\u3002<\/p>\n<p><strong>Q: \u4e3a\u4ec0\u4e48\u8981\u5347\u7ea7\u5230Python 3.5\uff1f\u6709\u4ec0\u4e48\u65b0\u7279\u6027\uff1f<\/strong><br \/>\nA: \u5347\u7ea7\u5230Python 3.5\u53ef\u4ee5\u8ba9\u60a8\u4eab\u53d7\u5230\u4e00\u4e9b\u65b0\u7684\u529f\u80fd\u548c\u6539\u8fdb\u3002 \u4f8b\u5982\uff0cPython 3.5\u5f15\u5165\u4e86\u5f02\u6b65\u7f16\u7a0b\u7684\u652f\u6301\uff0c\u8fd9\u53ef\u4ee5\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u53ef\u4f38\u7f29\u6027\u3002\u6b64\u5916\uff0c\u65b0\u7248\u672c\u8fd8\u5f15\u5165\u4e86\u4e00\u4e9b\u8bed\u6cd5\u6539\u8fdb\uff0c\u4f7f\u4ee3\u7801\u66f4\u7b80\u6d01\u6613\u8bfb\u3002\u8fd8\u6709\u4e00\u4e9b\u65b0\u7684\u6807\u51c6\u5e93\u51fd\u6570\u548c\u6a21\u5757\uff0c\u53ef\u4ee5\u4e3a\u60a8\u7684\u9879\u76ee\u63d0\u4f9b\u66f4\u591a\u7684\u529f\u80fd\u548c\u9009\u62e9\u3002\u603b\u7684\u6765\u8bf4\uff0c\u5347\u7ea7\u5230Python 3.5\u53ef\u4ee5\u4f7f\u60a8\u7684\u5f00\u53d1\u4f53\u9a8c\u66f4\u52a0\u4e30\u5bcc\u548c\u9ad8\u6548\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4ecePython 3.4 \u5347\u7ea7\u5230 Python 3.5\uff0c\u4e3b\u8981\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u51e0\u70b9\uff1a\u5907\u4efd\u5f53\u524d\u73af\u5883\u3001\u4e0b\u8f7d\u5e76\u5b89\u88c5Pytho [&hellip;]","protected":false},"author":3,"featured_media":174958,"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\/174949"}],"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=174949"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/174949\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/174958"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=174949"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=174949"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=174949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}