{"id":953326,"date":"2024-12-27T01:42:28","date_gmt":"2024-12-26T17:42:28","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/953326.html"},"modified":"2024-12-27T01:42:29","modified_gmt":"2024-12-26T17:42:29","slug":"%e5%a6%82%e4%bd%95%e6%89%93%e5%bc%80python3-6","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/953326.html","title":{"rendered":"\u5982\u4f55\u6253\u5f00python3.6"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25090846\/30b8df07-c817-4630-9499-2d45cb1a7ce1.webp\" alt=\"\u5982\u4f55\u6253\u5f00python3.6\" \/><\/p>\n<p><p> <strong>\u8981\u6253\u5f00Python 3.6\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u5f0f\uff1a\u4f7f\u7528\u547d\u4ee4\u884c\u6253\u5f00\u3001\u901a\u8fc7IDE\u6253\u5f00\u3001\u4f7f\u7528Jupyter Notebook\u3001\u5728\u865a\u62df\u73af\u5883\u4e2d\u8fd0\u884c<\/strong>\u3002\u5176\u4e2d\uff0c\u6700\u5e38\u89c1\u548c\u76f4\u63a5\u7684\u65b9\u6cd5\u662f\u901a\u8fc7\u547d\u4ee4\u884c\u6253\u5f00\u3002\u9996\u5148\uff0c\u786e\u4fddPython 3.6\u5df2\u5b89\u88c5\u5728\u8ba1\u7b97\u673a\u4e0a\uff0c\u7136\u540e\u6253\u5f00\u547d\u4ee4\u884c\u7ec8\u7aef\uff08Windows\u4e2d\u7684cmd\u6216Linux\/Mac\u4e2d\u7684Terminal\uff09\uff0c\u8f93\u5165\u547d\u4ee4<code>python3.6<\/code>\u6216<code>python3<\/code>\u5373\u53ef\u8fdb\u5165Python 3.6\u7684\u4ea4\u4e92\u5f0f\u73af\u5883\u3002\u5728\u8fd9\u79cd\u73af\u5883\u4e2d\uff0c\u60a8\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u6253\u5f00Python 3.6<\/p>\n<\/p>\n<p><p>\u4f7f\u7528\u547d\u4ee4\u884c\u662f\u6253\u5f00Python 3.6\u6700\u57fa\u7840\u4e14\u5e38\u7528\u7684\u65b9\u6cd5\u3002\u9996\u5148\uff0c\u60a8\u9700\u8981\u786e\u5b9aPython 3.6\u5df2\u6b63\u786e\u5b89\u88c5\u5728\u60a8\u7684\u7cfb\u7edf\u4e2d\u3002\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\u6765\u68c0\u67e5\u5f53\u524d\u5b89\u88c5\u7684Python\u7248\u672c\u3002\u5982\u679c\u60a8\u770b\u5230Python 3.6\u7684\u7248\u672c\u4fe1\u606f\uff0c\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6253\u5f00\u547d\u4ee4\u884c\u7ec8\u7aef<\/strong>\uff1a\u5728Windows\u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u5f00\u59cb\u83dc\u5355\u627e\u5230\u201c\u547d\u4ee4\u63d0\u793a\u7b26\u201d\u6216\u76f4\u63a5\u5728\u641c\u7d22\u680f\u8f93\u5165\u201ccmd\u201d\u5e76\u56de\u8f66\u3002\u5728Linux\u6216Mac\u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u5feb\u6377\u952e\uff08\u5982Ctrl+Alt+T\uff09\u6216\u5e94\u7528\u7a0b\u5e8f\u83dc\u5355\u6253\u5f00Terminal\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8f93\u5165\u542f\u52a8\u547d\u4ee4<\/strong>\uff1a\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python3.6<\/code>\u6216<code>python3<\/code>\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u952e\u3002\u6b64\u65f6\uff0c\u60a8\u5e94\u8be5\u770b\u5230Python 3.6\u7684\u6807\u8bc6\u4fe1\u606f\u4ee5\u53ca\u4ea4\u4e92\u5f0f\u63d0\u793a\u7b26<code>&gt;&gt;&gt;<\/code>\uff0c\u8fd9\u8868\u793a\u60a8\u5df2\u7ecf\u6210\u529f\u8fdb\u5165Python 3.6\u7684\u4ea4\u4e92\u73af\u5883\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884cPython\u4ee3\u7801<\/strong>\uff1a\u5728\u4ea4\u4e92\u5f0f\u73af\u5883\u4e2d\uff0c\u60a8\u53ef\u4ee5\u8f93\u5165Python\u4ee3\u7801\u5e76\u7acb\u5373\u6267\u884c\u3002\u6bd4\u5982\u8f93\u5165<code>print(&quot;Hello, World!&quot;)<\/code>\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\uff0c\u60a8\u5c06\u770b\u5230\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u901a\u8fc7IDE\u6253\u5f00Python 3.6<\/p>\n<\/p>\n<p><p>\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u53ef\u4ee5\u63d0\u4f9b\u66f4\u597d\u7684\u4ee3\u7801\u7f16\u8f91\u548c\u8c03\u8bd5\u4f53\u9a8c\u3002\u8bb8\u591aIDE\u90fd\u652f\u6301Python 3.6\uff0c\u5e76\u4e14\u53ef\u4ee5\u65b9\u4fbf\u5730\u7ba1\u7406\u9879\u76ee\u548c\u4f9d\u8d56\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u9009\u62e9\u5408\u9002\u7684IDE<\/strong>\uff1a\u5e38\u89c1\u7684Python IDE\u5305\u62ecPyCharm\u3001Visual Studio Code\u3001Spyder\u7b49\u3002\u8fd9\u4e9bIDE\u90fd\u652f\u6301\u591a\u7248\u672c\u7684Python\uff0c\u60a8\u53ef\u4ee5\u6839\u636e\u4e2a\u4eba\u559c\u597d\u9009\u62e9\u4f7f\u7528\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u914d\u7f6ePython\u89e3\u91ca\u5668<\/strong>\uff1a\u5728IDE\u4e2d\uff0c\u60a8\u9700\u8981\u6307\u5b9aPython 3.6\u4f5c\u4e3a\u9879\u76ee\u7684\u89e3\u91ca\u5668\u3002\u4ee5PyCharm\u4e3a\u4f8b\uff0c\u60a8\u53ef\u4ee5\u5728\u9879\u76ee\u8bbe\u7f6e\u4e2d\u627e\u5230\u201cInterpreter\u201d\u9009\u9879\uff0c\u7136\u540e\u9009\u62e9Python 3.6\u7684\u8def\u5f84\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efa\u5e76\u8fd0\u884c\u811a\u672c<\/strong>\uff1a\u5728IDE\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u6587\u4ef6\uff08\u5982<code>m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n.py<\/code>\uff09\uff0c\u7136\u540e\u7f16\u5199\u60a8\u7684Python\u4ee3\u7801\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7IDE\u7684\u8fd0\u884c\u6309\u94ae\u6765\u6267\u884c\u811a\u672c\uff0c\u5e76\u67e5\u770b\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u4f7f\u7528Jupyter Notebook<\/p>\n<\/p>\n<p><p>Jupyter Notebook\u662f\u4e00\u79cd\u4ea4\u4e92\u5f0f\u7684\u6587\u6863\u7f16\u8f91\u73af\u5883\uff0c\u9002\u5408\u7528\u4e8e\u6570\u636e\u5206\u6790\u548c\u53ef\u89c6\u5316\u3002\u5b83\u652f\u6301Python 3.6\uff0c\u5e76\u5141\u8bb8\u5728\u540c\u4e00\u4e2a\u73af\u5883\u4e2d\u8fd0\u884c\u4ee3\u7801\u3001\u67e5\u770b\u8f93\u51fa\u3001\u6dfb\u52a0\u6ce8\u91ca\u548c\u7ed8\u5236\u56fe\u5f62\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5Jupyter Notebook<\/strong>\uff1a\u5982\u679c\u5c1a\u672a\u5b89\u88c5Jupyter Notebook\uff0c\u53ef\u4ee5\u4f7f\u7528Python\u7684\u5305\u7ba1\u7406\u5de5\u5177pip\u6765\u5b89\u88c5\u3002\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>pip install jupyter<\/code>\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u542f\u52a8Jupyter Notebook<\/strong>\uff1a\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>jupyter notebook<\/code>\u5e76\u56de\u8f66\u3002\u6b64\u65f6\uff0c\u6d4f\u89c8\u5668\u5c06\u81ea\u52a8\u6253\u5f00\u5e76\u663e\u793aJupyter\u7684\u4e3b\u9875\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efa\u65b0\u7684Notebook<\/strong>\uff1a\u5728Jupyter\u4e3b\u9875\u4e2d\uff0c\u70b9\u51fb\u201cNew\u201d\u6309\u94ae\u5e76\u9009\u62e9\u201cPython 3\u201d\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Notebook\u3002\u5728\u65b0\u7684Notebook\u4e2d\uff0c\u60a8\u53ef\u4ee5\u7f16\u5199Python\u4ee3\u7801\u5e76\u901a\u8fc7\u8fd0\u884c\u5355\u5143\u6765\u67e5\u770b\u7ed3\u679c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u5728\u865a\u62df\u73af\u5883\u4e2d\u8fd0\u884cPython 3.6<\/p>\n<\/p>\n<p><p>\u865a\u62df\u73af\u5883\u53ef\u4ee5\u5e2e\u52a9\u60a8\u9694\u79bb\u9879\u76ee\u7684\u4f9d\u8d56\uff0c\u786e\u4fdd\u4e0d\u540c\u9879\u76ee\u4e4b\u95f4\u7684\u5e93\u7248\u672c\u4e0d\u51b2\u7a81\u3002\u8fd9\u5bf9\u4e8e\u9700\u8981\u7ba1\u7406\u591a\u4e2a\u9879\u76ee\u7684\u5f00\u53d1\u8005\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efa\u865a\u62df\u73af\u5883<\/strong>\uff1a\u4f7f\u7528Python\u5185\u7f6e\u7684<code>venv<\/code>\u6a21\u5757\u6216\u7b2c\u4e09\u65b9\u5de5\u5177\u5982<code>virtualenv<\/code>\u521b\u5efa\u865a\u62df\u73af\u5883\u3002\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python3.6 -m venv myenv<\/code>\uff0c\u8fd9\u5c06\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>myenv<\/code>\u7684\u865a\u62df\u73af\u5883\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6fc0\u6d3b\u865a\u62df\u73af\u5883<\/strong>\uff1a\u5728Windows\u4e2d\uff0c\u8fd0\u884c\u547d\u4ee4<code>myenv\\Scripts\\activate<\/code>\uff1b\u5728Linux\u6216Mac\u4e2d\uff0c\u8fd0\u884c\u547d\u4ee4<code>source myenv\/bin\/activate<\/code>\u3002\u6fc0\u6d3b\u540e\uff0c\u547d\u4ee4\u63d0\u793a\u7b26\u4f1a\u663e\u793a\u865a\u62df\u73af\u5883\u7684\u540d\u79f0\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u9879\u76ee\u4f9d\u8d56\u5e76\u8fd0\u884cPython 3.6<\/strong>\uff1a\u5728\u865a\u62df\u73af\u5883\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528pip\u5b89\u88c5\u9879\u76ee\u6240\u9700\u7684\u5e93\uff0c\u5e76\u901a\u8fc7\u547d\u4ee4<code>python<\/code>\u8fd0\u884cPython 3.6\u3002\u5728\u865a\u62df\u73af\u5883\u4e2d\uff0c<code>python<\/code>\u547d\u4ee4\u5c06\u9ed8\u8ba4\u6307\u5411\u8be5\u73af\u5883\u4e2d\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u51e0\u79cd\u65b9\u5f0f\uff0c\u60a8\u53ef\u4ee5\u7075\u6d3b\u5730\u6253\u5f00\u548c\u4f7f\u7528Python 3.6\uff0c\u6839\u636e\u4e0d\u540c\u7684\u9700\u6c42\u9009\u62e9\u6700\u5408\u9002\u7684\u65b9\u6cd5\uff0c\u63d0\u5347\u5f00\u53d1\u6548\u7387\u548c\u4f53\u9a8c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Windows\u7cfb\u7edf\u4e2d\u6253\u5f00Python 3.6\uff1f<\/strong><br \/>\u8981\u5728Windows\u7cfb\u7edf\u4e2d\u6253\u5f00Python 3.6\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u64cd\u4f5c\uff1a\u9996\u5148\uff0c\u786e\u4fddPython 3.6\u5df2\u6b63\u786e\u5b89\u88c5\u3002\u7136\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u201c\u5f00\u59cb\u201d\u83dc\u5355\u627e\u5230Python 3.6\u7684\u5feb\u6377\u65b9\u5f0f\uff0c\u6216\u8005\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165<code>python<\/code>\u547d\u4ee4\u3002\u5982\u679c\u60a8\u5e0c\u671b\u4f7f\u7528IDLE\u6216\u5176\u4ed6\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\uff0c\u53ef\u4ee5\u76f4\u63a5\u6253\u5f00\u76f8\u5e94\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p><strong>\u5728Mac\u7cfb\u7edf\u4e0a\u5982\u4f55\u8fd0\u884cPython 3.6\uff1f<\/strong><br \/>\u5728Mac\u7cfb\u7edf\u4e0a\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u7ec8\u7aef\u6253\u5f00Python 3.6\u3002\u6253\u5f00\u7ec8\u7aef\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u8f93\u5165<code>python3.6<\/code>\u547d\u4ee4\u3002\u5982\u679c\u60a8\u7684\u7cfb\u7edf\u4e2d\u5b89\u88c5\u4e86\u591a\u4e2a\u7248\u672c\u7684Python\uff0c\u786e\u4fdd\u4f7f\u7528\u7684\u662f\u6b63\u786e\u7684\u7248\u672c\u3002\u60a8\u4e5f\u53ef\u4ee5\u8003\u8651\u4f7f\u7528Homebrew\u6765\u7ba1\u7406Python\u7248\u672c\uff0c\u786e\u4fdd\u60a8\u80fd\u591f\u8f7b\u677e\u5207\u6362\u548c\u4f7f\u7528\u4e0d\u540c\u7684Python\u7248\u672c\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Linux\u4e0a\u542f\u52a8Python 3.6\uff1f<\/strong><br \/>\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u7ec8\u7aef\u6253\u5f00Python 3.6\u3002\u53ea\u9700\u6253\u5f00\u7ec8\u7aef\u5e76\u8f93\u5165<code>python3.6<\/code>\u547d\u4ee4\u5373\u53ef\u3002\u5982\u679c\u60a8\u6ca1\u6709\u5b89\u88c5Python 3.6\uff0c\u53ef\u4ee5\u4f7f\u7528\u5305\u7ba1\u7406\u5668\uff08\u5982apt\u6216yum\uff09\u6765\u5b89\u88c5\u5b83\u3002\u786e\u4fdd\u5728\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u80fd\u591f\u5728\u7ec8\u7aef\u4e2d\u8bbf\u95ee\u8be5\u7248\u672c\u7684Python\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u6253\u5f00Python 3.6\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u5f0f\uff1a\u4f7f\u7528\u547d\u4ee4\u884c\u6253\u5f00\u3001\u901a\u8fc7IDE\u6253\u5f00\u3001\u4f7f\u7528Jupyter Note [&hellip;]","protected":false},"author":3,"featured_media":953328,"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\/953326"}],"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=953326"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/953326\/revisions"}],"predecessor-version":[{"id":953329,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/953326\/revisions\/953329"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/953328"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=953326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=953326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=953326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}