{"id":1109070,"date":"2025-01-08T17:06:35","date_gmt":"2025-01-08T09:06:35","guid":{"rendered":""},"modified":"2025-01-08T17:06:41","modified_gmt":"2025-01-08T09:06:41","slug":"win8%e5%a6%82%e4%bd%95%e7%94%a8python%e8%bf%90%e8%a1%8cpy%e6%96%87%e4%bb%b6-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1109070.html","title":{"rendered":"win8\u5982\u4f55\u7528Python\u8fd0\u884cpy\u6587\u4ef6"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25072501\/3efa380c-d287-4097-ba64-f4217363b3f1.webp\" alt=\"win8\u5982\u4f55\u7528Python\u8fd0\u884cpy\u6587\u4ef6\" \/><\/p>\n<p><p> <strong>\u5728Windows 8\u4e0a\u4f7f\u7528Python\u8fd0\u884cpy\u6587\u4ef6\u7684\u65b9\u6cd5<\/strong><\/p>\n<\/p>\n<p><p>\u5728Windows 8\u4e0a\u8fd0\u884cPython\u6587\u4ef6\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u786e\u4fdd\u4f60\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\u4e86Python\u5e76\u914d\u7f6e\u4e86\u73af\u5883\u53d8\u91cf\u3002<strong>\u5b89\u88c5Python\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3001\u4f7f\u7528\u547d\u4ee4\u63d0\u793a\u7b26\uff08cmd\uff09\u8fd0\u884c\u3001\u4f7f\u7528IDE\u8fd0\u884c<\/strong>\u8fd9\u4e9b\u6b65\u9aa4\u90fd\u53ef\u4ee5\u5e2e\u52a9\u4f60\u5728Windows 8\u4e0a\u987a\u5229\u8fd0\u884cPython\u6587\u4ef6\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5b8c\u6210\u8fd9\u4e9b\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u5b89\u88c5Python<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4e0b\u8f7dPython<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u9996\u5148\uff0c\u4f60\u9700\u8981\u4ecePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.python.org\/%EF%BC%89%E4%B8%8B%E8%BD%BD%E9%80%82%E7%94%A8%E4%BA%8EWindows%E7%9A%84Python%E5%AE%89%E8%A3%85%E7%A8%8B%E5%BA%8F%E3%80%82%E9%80%89%E6%8B%A9%E9%80%82%E5%90%88%E4%BD%A0%E7%B3%BB%E7%BB%9F%E6%9E%B6%E6%9E%84%E7%9A%84%E7%89%88%E6%9C%AC%EF%BC%8832%E4%BD%8D%E6%88%9664%E4%BD%8D%EF%BC%89%E3%80%82\">https:\/\/www.python.org\/\uff09\u4e0b\u8f7d\u9002\u7528\u4e8eWindows\u7684Python\u5b89\u88c5\u7a0b\u5e8f\u3002\u9009\u62e9\u9002\u5408\u4f60\u7cfb\u7edf\u67b6\u6784\u7684\u7248\u672c\uff0832\u4f4d\u621664\u4f4d\uff09\u3002<\/a><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Python<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u3002\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u786e\u4fdd\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u8fd9\u5c06\u81ea\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3002<\/li>\n<li>\u9009\u62e9\u201cInstall Now\u201d\u8fdb\u884c\u5feb\u901f\u5b89\u88c5\uff0c\u6216\u8005\u9009\u62e9\u201cCustomize installation\u201d\u8fdb\u884c\u81ea\u5b9a\u4e49\u5b89\u88c5\uff0c\u6839\u636e\u4f60\u7684\u9700\u6c42\u9009\u62e9\u5b89\u88c5\u8def\u5f84\u548c\u7ec4\u4ef6\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u4e8c\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/h3>\n<\/p>\n<p><p>\u5c3d\u7ba1\u5728\u5b89\u88c5Python\u65f6\u9009\u62e9\u4e86\u201cAdd Python to PATH\u201d\uff0c\u5982\u679c\u4f60\u5fd8\u8bb0\u52fe\u9009\u8fd9\u4e2a\u9009\u9879\uff0c\u53ef\u4ee5\u624b\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6253\u5f00\u7cfb\u7edf\u5c5e\u6027<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u53f3\u952e\u5355\u51fb\u201c\u8ba1\u7b97\u673a\u201d\u56fe\u6807\uff0c\u9009\u62e9\u201c\u5c5e\u6027\u201d\uff0c\u7136\u540e\u70b9\u51fb\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7f16\u8f91\u73af\u5883\u53d8\u91cf<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\u7a97\u53e3\u4e2d\uff0c\u70b9\u51fb\u201c\u73af\u5883\u53d8\u91cf\u201d\u6309\u94ae\u3002<\/li>\n<li>\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u90e8\u5206\uff0c\u627e\u5230\u540d\u4e3a\u201cPath\u201d\u7684\u53d8\u91cf\uff0c\u9009\u4e2d\u5b83\u5e76\u70b9\u51fb\u201c\u7f16\u8f91\u201d\u3002<\/li>\n<li>\u5728\u201c\u7f16\u8f91\u73af\u5883\u53d8\u91cf\u201d\u7a97\u53e3\u4e2d\uff0c\u70b9\u51fb\u201c\u65b0\u5efa\u201d\uff0c\u7136\u540e\u8f93\u5165Python\u7684\u5b89\u88c5\u8def\u5f84\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u5b89\u88c5\u5728\u9ed8\u8ba4\u4f4d\u7f6e\uff0c\u5219\u8def\u5f84\u53ef\u80fd\u662f<code>C:\\Python39<\/code>\uff08\u5177\u4f53\u8def\u5f84\u53d6\u51b3\u4e8e\u4f60\u7684Python\u7248\u672c\uff09\u3002<\/li>\n<li>\u540c\u6837\uff0c\u6dfb\u52a0Python\u7684Scripts\u76ee\u5f55\u8def\u5f84\uff0c\u4f8b\u5982<code>C:\\Python39\\Scripts<\/code>\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff08\u6309<code>Win+R<\/code>\uff0c\u8f93\u5165<code>cmd<\/code>\u5e76\u56de\u8f66\uff09\uff0c\u7136\u540e\u8f93\u5165<code>python --version<\/code>\u3002\u5982\u679c\u663e\u793aPython\u7248\u672c\u53f7\uff0c\u8bf4\u660e\u914d\u7f6e\u6210\u529f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u547d\u4ee4\u63d0\u793a\u7b26\uff08cmd\uff09\u8fd0\u884cPython\u6587\u4ef6<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6309<code>Win+R<\/code>\uff0c\u8f93\u5165<code>cmd<\/code>\u5e76\u56de\u8f66\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5bfc\u822a\u5230Python\u6587\u4ef6\u6240\u5728\u76ee\u5f55<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u5207\u6362\u5230\u5305\u542bPython\u6587\u4ef6\u7684\u76ee\u5f55\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u7684Python\u6587\u4ef6\u4f4d\u4e8e<code>C:\\Scripts<\/code>\u76ee\u5f55\u4e0b\uff0c\u8f93\u5165<code>cd C:\\Scripts<\/code>\u5e76\u56de\u8f66\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884cPython\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u8f93\u5165<code>python filename.py<\/code>\u5e76\u56de\u8f66\uff08\u5c06<code>filename.py<\/code>\u66ff\u6362\u4e3a\u4f60\u5b9e\u9645\u7684Python\u6587\u4ef6\u540d\uff09\u3002\u5982\u679cPython\u6587\u4ef6\u4e2d\u6ca1\u6709\u9519\u8bef\uff0c\u811a\u672c\u5c06\u4f1a\u8fd0\u884c\u5e76\u8f93\u51fa\u7ed3\u679c\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u56db\u3001\u4f7f\u7528IDE\u8fd0\u884cPython\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u4f7f\u7528\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u6765\u8fd0\u884cPython\u6587\u4ef6\u3002\u5e38\u89c1\u7684Python IDE\u5305\u62ecPyCharm\u3001VS Code\u3001Spyder\u7b49\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5IDE<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u9009\u62e9\u5e76\u4e0b\u8f7d\u4f60\u559c\u6b22\u7684IDE\u3002\u4f8b\u5982\uff0c\u4ecePyCharm\u5b98\u7f51\uff08<a href=\"https:\/\/www.jetbrains.com\/pycharm\/%EF%BC%89%E4%B8%8B%E8%BD%BD%E5%B9%B6%E5%AE%89%E8%A3%85PyCharm%E3%80%82\">https:\/\/www.jetbr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>ns.com\/pycharm\/\uff09\u4e0b\u8f7d\u5e76\u5b89\u88c5PyCharm\u3002<\/a><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u914d\u7f6ePython\u89e3\u91ca\u5668<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00IDE\uff0c\u5728\u8bbe\u7f6e\u6216\u9996\u9009\u9879\u4e2d\u627e\u5230Python\u89e3\u91ca\u5668\u9009\u9879\uff0c\u6dfb\u52a0\u4f60\u5b89\u88c5\u7684Python\u8def\u5f84\u4f5c\u4e3a\u89e3\u91ca\u5668\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u6253\u5f00Python\u6587\u4ef6\u5e76\u8fd0\u884c<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728IDE\u4e2d\u6253\u5f00\u4f60\u7684Python\u6587\u4ef6\uff0c\u7136\u540e\u70b9\u51fb\u8fd0\u884c\u6309\u94ae\u6216\u4f7f\u7528\u5feb\u6377\u952e\uff08\u901a\u5e38\u662f<code>Shift+F10<\/code>\uff09\u6765\u8fd0\u884c\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u4e94\u3001\u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6cd5<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>Python\u672a\u6dfb\u52a0\u5230PATH<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5982\u679c\u5b89\u88c5Python\u65f6\u672a\u6dfb\u52a0\u5230PATH\uff0c\u53ef\u4ee5\u624b\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u6216\u8005\u91cd\u65b0\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u5e76\u9009\u62e9\u201cModify\u201d\u9009\u9879\uff0c\u52fe\u9009\u201cAdd Python to PATH\u201d\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u547d\u4ee4\u63d0\u793a\u7b26\u627e\u4e0d\u5230Python<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u786e\u4fdd\u5df2\u6b63\u786e\u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u5e76\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u91cd\u65b0\u542f\u52a8\u4ee5\u4f7f\u66f4\u6539\u751f\u6548\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>IDE\u65e0\u6cd5\u8fd0\u884cPython\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u68c0\u67e5IDE\u4e2d\u7684Python\u89e3\u91ca\u5668\u914d\u7f6e\uff0c\u786e\u4fdd\u9009\u62e9\u4e86\u6b63\u786e\u7684Python\u5b89\u88c5\u8def\u5f84\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u5e94\u8be5\u80fd\u591f\u5728Windows 8\u4e0a\u987a\u5229\u8fd0\u884cPython\u6587\u4ef6\u3002\u5982\u679c\u4ecd\u6709\u95ee\u9898\uff0c\u53c2\u8003Python\u5b98\u65b9\u6587\u6863\u6216\u793e\u533a\u8bba\u575b\u5bfb\u6c42\u5e2e\u52a9\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Windows 8\u4e0a\u5b89\u88c5Python\u4ee5\u4fbf\u8fd0\u884cpy\u6587\u4ef6\uff1f<\/strong><br \/>\u8981\u5728Windows 8\u4e0a\u8fd0\u884cpy\u6587\u4ef6\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u4f60\u7684\u7cfb\u7edf\u4e0a\u5b89\u88c5\u4e86Python\u3002\u53ef\u4ee5\u901a\u8fc7\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u9002\u5408Windows\u7684\u5b89\u88c5\u5305\u3002\u5b89\u88c5\u65f6\uff0c\u8bf7\u786e\u4fdd\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u8fd9\u6837\u4f60\u5728\u547d\u4ee4\u884c\u4e2d\u5c31\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528Python\u547d\u4ee4\u3002<\/p>\n<p><strong>\u5982\u4f55\u901a\u8fc7\u547d\u4ee4\u63d0\u793a\u7b26\u8fd0\u884cpy\u6587\u4ef6\uff1f<\/strong><br \/>\u5728Windows 8\u4e0a\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u63d0\u793a\u7b26\u8fd0\u884cpy\u6587\u4ef6\u3002\u9996\u5148\uff0c\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u5bfc\u822a\u5230\u5305\u542b\u4f60\u7684py\u6587\u4ef6\u7684\u76ee\u5f55\u3002\u63a5\u7740\uff0c\u8f93\u5165<code>python \u6587\u4ef6\u540d.py<\/code>\u6765\u6267\u884c\u6587\u4ef6\uff08\u8bf7\u5c06\u201c\u6587\u4ef6\u540d\u201d\u66ff\u6362\u4e3a\u4f60\u7684\u5b9e\u9645\u6587\u4ef6\u540d\uff09\u3002\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662fPython 3\uff0c\u53ef\u4ee5\u4f7f\u7528<code>python3 \u6587\u4ef6\u540d.py<\/code>\u3002<\/p>\n<p><strong>\u5982\u679c\u5728\u8fd0\u884cpy\u6587\u4ef6\u65f6\u51fa\u73b0\u9519\u8bef\uff0c\u5e94\u8be5\u5982\u4f55\u89e3\u51b3\uff1f<\/strong><br \/>\u8fd0\u884cpy\u6587\u4ef6\u65f6\u53ef\u80fd\u4f1a\u9047\u5230\u9519\u8bef\uff0c\u4f8b\u5982\u201c\u627e\u4e0d\u5230\u6a21\u5757\u201d\u6216\u201c\u8bed\u6cd5\u9519\u8bef\u201d\u3002\u9996\u5148\uff0c\u8bf7\u68c0\u67e5\u4f60\u7684Python\u7248\u672c\u662f\u5426\u4e0e\u4ee3\u7801\u517c\u5bb9\u3002\u5176\u6b21\uff0c\u786e\u4fdd\u6240\u9700\u7684\u6a21\u5757\u5df2\u7ecf\u5b89\u88c5\uff0c\u53ef\u4ee5\u901a\u8fc7<code>pip install \u6a21\u5757\u540d<\/code>\u8fdb\u884c\u5b89\u88c5\u3002\u5982\u679c\u9519\u8bef\u4fe1\u606f\u4e0d\u660e\u786e\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u5728\u7f51\u4e0a\u641c\u7d22\u5177\u4f53\u7684\u9519\u8bef\u4ee3\u7801\uff0c\u901a\u5e38\u4f1a\u6709\u89e3\u51b3\u65b9\u6848\u6216\u8ba8\u8bba\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Windows 8\u4e0a\u4f7f\u7528Python\u8fd0\u884cpy\u6587\u4ef6\u7684\u65b9\u6cd5 \u5728Windows 8\u4e0a\u8fd0\u884cPython\u6587\u4ef6\u975e\u5e38\u7b80\u5355\uff0c [&hellip;]","protected":false},"author":3,"featured_media":1109089,"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\/1109070"}],"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=1109070"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1109070\/revisions"}],"predecessor-version":[{"id":1109092,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1109070\/revisions\/1109092"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1109089"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1109070"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1109070"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1109070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}