{"id":975474,"date":"2024-12-27T06:13:35","date_gmt":"2024-12-26T22:13:35","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/975474.html"},"modified":"2024-12-27T06:13:38","modified_gmt":"2024-12-26T22:13:38","slug":"spyder%e5%a6%82%e4%bd%95%e6%9f%a5%e7%9c%8bpython%e7%89%88%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/975474.html","title":{"rendered":"spyder\u5982\u4f55\u67e5\u770bpython\u7248\u672c"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24200711\/45d3252f-75cf-4322-ba5d-4e40df7ad5e3.webp\" alt=\"spyder\u5982\u4f55\u67e5\u770bpython\u7248\u672c\" \/><\/p>\n<p><p> <strong>\u5728Spyder\u4e2d\u67e5\u770bPython\u7248\u672c\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528\u5185\u7f6e\u547d\u4ee4\u3001\u67e5\u770b\u73af\u5883\u4fe1\u606f\u3001\u68c0\u67e5\u542f\u52a8\u4fe1\u606f\u3002<\/strong><\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528\u5185\u7f6e\u547d\u4ee4<\/strong>\u662f\u67e5\u770bPython\u7248\u672c\u6700\u76f4\u63a5\u7684\u65b9\u6cd5\u3002\u5728Spyder\u7684IPython\u63a7\u5236\u53f0\u4e2d\uff0c\u4f60\u53ef\u4ee5\u8f93\u5165<code>!python --version<\/code>\u6216<code>!python -V<\/code>\uff0c\u7cfb\u7edf\u5c06\u8fd4\u56de\u5f53\u524d\u4f7f\u7528\u7684Python\u7248\u672c\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u8ba8\u8bba\u6bcf\u79cd\u65b9\u6cd5\u7684\u5177\u4f53\u6b65\u9aa4\u548c\u4f18\u7f3a\u70b9\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528\u5185\u7f6e\u547d\u4ee4<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528\u5185\u7f6e\u547d\u4ee4\u662f\u67e5\u770bPython\u7248\u672c\u7684\u6700\u5feb\u6377\u65b9\u5f0f\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u6253\u5f00Spyder<\/strong>\uff1a\u542f\u52a8\u4f60\u7684Spyder IDE\u3002<\/li>\n<li><strong>\u6253\u5f00IPython\u63a7\u5236\u53f0<\/strong>\uff1a\u5728Spyder\u7684\u4e3b\u754c\u9762\u4e2d\uff0c\u627e\u5230\u5e76\u6253\u5f00IPython\u63a7\u5236\u53f0\u3002<\/li>\n<li><strong>\u8f93\u5165\u547d\u4ee4<\/strong>\uff1a\u5728IPython\u63a7\u5236\u53f0\u4e2d\u8f93\u5165<code>!python --version<\/code>\u6216<code>!python -V<\/code>\u3002<\/li>\n<li><strong>\u67e5\u770b\u8f93\u51fa<\/strong>\uff1a\u6309\u4e0bEnter\u952e\u540e\uff0cPython\u7248\u672c\u4fe1\u606f\u5c06\u663e\u793a\u5728\u63a7\u5236\u53f0\u4e2d\u3002<\/li>\n<\/ol>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u7684\u4f18\u70b9\u662f\u7b80\u5355\u6613\u884c\uff0c\u9002\u7528\u4e8e\u5927\u591a\u6570\u7528\u6237\u548c\u73af\u5883\u3002\u7136\u800c\uff0c\u8be5\u65b9\u6cd5\u4f9d\u8d56\u4e8e\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u4e2d\u7684Python\u8def\u5f84\uff0c\u5982\u679c\u591a\u4e2aPython\u7248\u672c\u5171\u5b58\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u6df7\u6dc6\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u67e5\u770b\u73af\u5883\u4fe1\u606f<\/h3>\n<\/p>\n<p><p>Spyder\u5141\u8bb8\u4f60\u67e5\u770b\u5f53\u524d\u6b63\u5728\u4f7f\u7528\u7684Python\u73af\u5883\u4fe1\u606f\uff0c\u8fd9\u53ef\u4ee5\u5e2e\u52a9\u4f60\u786e\u8ba4\u5f53\u524d\u4f7f\u7528\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u6253\u5f00\u5de5\u5177\u9009\u9879<\/strong>\uff1a\u5728Spyder\u7684\u83dc\u5355\u680f\u4e2d\uff0c\u70b9\u51fb\u201c\u5de5\u5177\u201d\u9009\u9879\u3002<\/li>\n<li><strong>\u9009\u62e9PYTHON\u63a7\u5236\u53f0<\/strong>\uff1a\u5728\u4e0b\u62c9\u83dc\u5355\u4e2d\u9009\u62e9\u201cPYTHON\u63a7\u5236\u53f0\u201d\u3002<\/li>\n<li><strong>\u67e5\u770bPython\u8def\u5f84\u548c\u7248\u672c<\/strong>\uff1a\u5728\u5f39\u51fa\u7684\u7a97\u53e3\u4e2d\uff0c\u4f60\u53ef\u4ee5\u770b\u5230\u5f53\u524d\u4f7f\u7528\u7684Python\u89e3\u91ca\u5668\u8def\u5f84\u548c\u7248\u672c\u4fe1\u606f\u3002<\/li>\n<\/ol>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u7684\u4f18\u70b9\u662f\u53ef\u4ee5\u63d0\u4f9b\u8be6\u7ec6\u7684\u73af\u5883\u4fe1\u606f\uff0c\u5e2e\u52a9\u6392\u67e5\u591a\u7248\u672c\u5171\u5b58\u7684\u95ee\u9898\u3002\u7136\u800c\uff0c\u9700\u8981\u4e00\u4e9b\u989d\u5916\u7684\u64cd\u4f5c\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u68c0\u67e5\u542f\u52a8\u4fe1\u606f<\/h3>\n<\/p>\n<p><p>\u6bcf\u6b21\u542f\u52a8Spyder\u65f6\uff0c\u63a7\u5236\u53f0\u90fd\u4f1a\u8f93\u51fa\u4e00\u4e9b\u542f\u52a8\u4fe1\u606f\uff0c\u5176\u4e2d\u5305\u62ecPython\u7248\u672c\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u542f\u52a8Spyder<\/strong>\uff1a\u6253\u5f00Spyder\uff0c\u7b49\u5f85\u542f\u52a8\u5b8c\u6210\u3002<\/li>\n<li><strong>\u67e5\u770b\u63a7\u5236\u53f0\u8f93\u51fa<\/strong>\uff1a\u5728\u63a7\u5236\u53f0\u7684\u542f\u52a8\u4fe1\u606f\u4e2d\uff0c\u67e5\u627e\u7c7b\u4f3c<code>Python 3.x.x<\/code>\u7684\u5b57\u6837\u3002<\/li>\n<\/ol>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u7684\u4f18\u70b9\u662f\u65e0\u9700\u989d\u5916\u8f93\u5165\u547d\u4ee4\uff0c\u542f\u52a8\u65f6\u5373\u53ef\u83b7\u53d6\u4fe1\u606f\u3002\u4f46\u5982\u679c\u542f\u52a8\u4fe1\u606f\u88ab\u6e05\u9664\uff0c\u53ef\u80fd\u65e0\u6cd5\u67e5\u770b\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528Anaconda Navigator<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u901a\u8fc7Anaconda\u5b89\u88c5\u4e86Spyder\uff0c\u4f60\u4e5f\u53ef\u4ee5\u901a\u8fc7Anaconda Navigator\u67e5\u770bPython\u7248\u672c\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u6253\u5f00Anaconda Navigator<\/strong>\uff1a\u542f\u52a8Anaconda Navigator\u3002<\/li>\n<li><strong>\u67e5\u770b\u73af\u5883<\/strong>\uff1a\u5728Navigator\u4e2d\u9009\u62e9\u201c\u73af\u5883\u201d\u6807\u7b7e\u3002<\/li>\n<li><strong>\u67e5\u770bPython\u7248\u672c<\/strong>\uff1a\u5728\u6240\u9009\u73af\u5883\u4e2d\uff0c\u4f60\u53ef\u4ee5\u770b\u5230\u5b89\u88c5\u7684Python\u7248\u672c\u3002<\/li>\n<\/ol>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u4f7f\u7528Anaconda\u7684\u7528\u6237\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u7ba1\u7406\u591a\u4e2a\u73af\u5883\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u5728\u4ee3\u7801\u4e2d\u68c0\u67e5<\/h3>\n<\/p>\n<p><p>\u4f60\u4e5f\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u901a\u8fc7<code>sys<\/code>\u6a21\u5757\u68c0\u67e5Python\u7248\u672c\uff0c\u9002\u7528\u4e8e\u9700\u8981\u52a8\u6001\u83b7\u53d6\u7248\u672c\u4fe1\u606f\u7684\u573a\u666f\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u5bfc\u5165sys\u6a21\u5757<\/strong>\uff1a\u5728Spyder\u7684\u7f16\u8f91\u5668\u4e2d\uff0c\u65b0\u5efa\u4e00\u4e2aPython\u6587\u4ef6\u5e76\u8f93\u5165<code>import sys<\/code>\u3002<\/li>\n<li><strong>\u6253\u5370\u7248\u672c\u4fe1\u606f<\/strong>\uff1a\u4f7f\u7528<code>print(sys.version)<\/code>\u6253\u5370Python\u7248\u672c\u4fe1\u606f\u3002<\/li>\n<li><strong>\u8fd0\u884c\u4ee3\u7801<\/strong>\uff1a\u5728\u63a7\u5236\u53f0\u4e2d\u8fd0\u884c\u8fd9\u6bb5\u4ee3\u7801\uff0c\u67e5\u770b\u8f93\u51fa\u7684\u7248\u672c\u4fe1\u606f\u3002<\/li>\n<\/ol>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u7684\u4f18\u70b9\u662f\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u52a8\u6001\u83b7\u53d6Python\u7248\u672c\uff0c\u9002\u7528\u4e8e\u9700\u8981\u5728\u7a0b\u5e8f\u4e2d\u5224\u65ad\u7248\u672c\u7684\u573a\u666f\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u5e38\u89c1\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6cd5<\/h3>\n<\/p>\n<ol>\n<li><strong>\u591a\u4e2aPython\u7248\u672c\u5171\u5b58<\/strong>\uff1a\u5982\u679c\u4f60\u7684\u7cfb\u7edf\u4e2d\u5b58\u5728\u591a\u4e2aPython\u7248\u672c\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6df7\u6dc6\u3002\u5efa\u8bae\u4f7f\u7528\u865a\u62df\u73af\u5883\u6216Anaconda\u6765\u7ba1\u7406\u4e0d\u540c\u7684Python\u7248\u672c\u548c\u5305\u3002<\/li>\n<li><strong>\u7248\u672c\u4fe1\u606f\u663e\u793a\u4e0d\u6b63\u786e<\/strong>\uff1a\u5982\u679cSpyder\u663e\u793a\u7684Python\u7248\u672c\u4fe1\u606f\u4e0d\u6b63\u786e\uff0c\u68c0\u67e5\u4f60\u7684\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\uff0c\u786e\u4fddPython\u8def\u5f84\u6b63\u786e\u3002<\/li>\n<li><strong>\u65e0\u6cd5\u542f\u52a8Spyder<\/strong>\uff1a\u5982\u679cSpyder\u65e0\u6cd5\u542f\u52a8\uff0c\u53ef\u80fd\u662f\u7531\u4e8e\u7248\u672c\u4e0d\u517c\u5bb9\u5bfc\u81f4\u3002\u5c1d\u8bd5\u66f4\u65b0\u6216\u91cd\u88c5Spyder\u548c\u76f8\u5173\u4f9d\u8d56\u3002<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u4f60\u53ef\u4ee5\u8f7b\u677e\u67e5\u770bSpyder\u4e2d\u4f7f\u7528\u7684Python\u7248\u672c\u3002\u9009\u62e9\u9002\u5408\u4f60\u9700\u6c42\u7684\u65b9\u6cd5\uff0c\u786e\u4fdd\u5f00\u53d1\u73af\u5883\u7684\u7a33\u5b9a\u6027\u548c\u4e00\u81f4\u6027\u3002\u65e0\u8bba\u662f\u901a\u8fc7\u63a7\u5236\u53f0\u547d\u4ee4\u3001\u67e5\u770b\u73af\u5883\u4fe1\u606f\uff0c\u8fd8\u662f\u5728\u4ee3\u7801\u4e2d\u52a8\u6001\u83b7\u53d6\u7248\u672c\uff0c\u90fd\u80fd\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7ba1\u7406\u548c\u4f7f\u7528Python\u73af\u5883\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Spyder\u4e2d\u67e5\u770bPython\u7684\u5177\u4f53\u7248\u672c\u4fe1\u606f\uff1f<\/strong><br \/>\u5728Spyder\u7684\u4e3b\u754c\u9762\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u70b9\u51fb\u83dc\u5355\u680f\u7684\u201cConsole\u201d\u9009\u9879\uff0c\u7136\u540e\u9009\u62e9\u201cOpen an IPython console\u201d\uff0c\u5728\u6253\u5f00\u7684\u63a7\u5236\u53f0\u4e2d\u8f93\u5165<code>import sys<\/code>\u548c<code>print(sys.version)<\/code>\u547d\u4ee4\u3002\u8fd9\u5c06\u663e\u793aPython\u7684\u7248\u672c\u4fe1\u606f\uff0c\u5305\u62ec\u4e3b\u8981\u7248\u672c\u53f7\u3001\u6b21\u8981\u7248\u672c\u53f7\u548c\u5176\u4ed6\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n<p><strong>Spyder\u4e2d\u662f\u5426\u6709\u5185\u7f6e\u529f\u80fd\u6765\u67e5\u770bPython\u7248\u672c\uff1f<\/strong><br \/>\u662f\u7684\uff0cSpyder\u7684\u201cHelp\u201d\u83dc\u5355\u4e2d\u5305\u542b\u201cAbout\u201d\u9009\u9879\uff0c\u70b9\u51fb\u540e\u4f1a\u5f39\u51fa\u4e00\u4e2a\u7a97\u53e3\uff0c\u663e\u793a\u5f53\u524d\u4f7f\u7528\u7684Python\u7248\u672c\u4ee5\u53caSpyder\u7684\u7248\u672c\u4fe1\u606f\u3002\u8fd9\u662f\u4e00\u79cd\u5feb\u901f\u4e14\u65b9\u4fbf\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u8ba9\u4f60\u4e00\u76ee\u4e86\u7136\u3002<\/p>\n<p><strong>\u5982\u679cSpyder\u65e0\u6cd5\u663e\u793aPython\u7248\u672c\uff0c\u6211\u8be5\u5982\u4f55\u89e3\u51b3\uff1f<\/strong><br \/>\u5982\u679c\u5728Spyder\u4e2d\u65e0\u6cd5\u67e5\u770bPython\u7248\u672c\uff0c\u53ef\u80fd\u662f\u7531\u4e8e\u73af\u5883\u914d\u7f6e\u95ee\u9898\u3002\u4f60\u53ef\u4ee5\u5c1d\u8bd5\u91cd\u542fSpyder\uff0c\u6216\u8005\u68c0\u67e5Python\u7684\u5b89\u88c5\u662f\u5426\u6b63\u786e\u3002\u5982\u679c\u95ee\u9898\u4f9d\u7136\u5b58\u5728\uff0c\u8003\u8651\u5728\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u4e2d\u4f7f\u7528<code>python --version<\/code>\u547d\u4ee4\u6765\u786e\u8ba4Python\u7684\u7248\u672c\uff0c\u786e\u4fddSpyder\u4f7f\u7528\u7684\u662f\u4f60\u671f\u671b\u7684Python\u73af\u5883\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Spyder\u4e2d\u67e5\u770bPython\u7248\u672c\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528\u5185\u7f6e\u547d\u4ee4\u3001\u67e5\u770b\u73af\u5883\u4fe1\u606f\u3001\u68c0\u67e5\u542f\u52a8\u4fe1\u606f\u3002 \u4f7f\u7528\u5185\u7f6e\u547d\u4ee4\u662f\u67e5\u770b [&hellip;]","protected":false},"author":3,"featured_media":975489,"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\/975474"}],"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=975474"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/975474\/revisions"}],"predecessor-version":[{"id":975492,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/975474\/revisions\/975492"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/975489"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=975474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=975474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=975474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}