{"id":984895,"date":"2024-12-27T07:32:10","date_gmt":"2024-12-26T23:32:10","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/984895.html"},"modified":"2024-12-27T07:32:13","modified_gmt":"2024-12-26T23:32:13","slug":"%e6%96%b0%e7%94%b5%e8%84%91%e5%a6%82%e4%bd%95%e4%b8%8b%e8%bd%bdpython","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/984895.html","title":{"rendered":"\u65b0\u7535\u8111\u5982\u4f55\u4e0b\u8f7dpython"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24212313\/0a204359-2b9f-468c-89a4-6c6d27da1df4.webp\" alt=\"\u65b0\u7535\u8111\u5982\u4f55\u4e0b\u8f7dpython\" \/><\/p>\n<p><p> \u65b0\u7535\u8111\u4e0b\u8f7dPython\u7684\u6b65\u9aa4\u4e3b\u8981\u5305\u62ec\uff1a<strong>\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\u3001\u9009\u62e9\u5408\u9002\u7684Python\u7248\u672c\u3001\u4e0b\u8f7d\u5e76\u5b89\u88c5Python\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/strong>\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<p><p>\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\u662f\u4e0b\u8f7dPython\u7684\u7b2c\u4e00\u6b65\u3002\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165\u201cpython.org\u201d\uff0c\u8fdb\u5165\u5b98\u65b9\u7f51\u7ad9\u3002Python.org\u662fPython\u8bed\u8a00\u7684\u5b98\u65b9\u8d44\u6e90\uff0c\u63d0\u4f9b\u4e86\u6700\u65b0\u7248\u672c\u7684\u4e0b\u8f7d\u94fe\u63a5\u548c\u4e30\u5bcc\u7684\u6587\u6863\u8d44\u6e90\u3002\u9009\u62e9\u5408\u9002\u7684Python\u7248\u672c\u662f\u5173\u952e\uff0c\u56e0\u4e3a\u4e0d\u540c\u7248\u672c\u5728\u529f\u80fd\u548c\u517c\u5bb9\u6027\u4e0a\u6709\u6240\u4e0d\u540c\u3002\u4e00\u822c\u6765\u8bf4\uff0c\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u672c\u662f\u63a8\u8350\u7684\u9009\u62e9\uff0c\u56e0\u4e3a\u5b83\u5305\u542b\u4e86\u6700\u65b0\u7684\u529f\u80fd\u548c\u5b89\u5168\u8865\u4e01\u3002<\/p>\n<\/p>\n<p><p>\u5728\u5b98\u65b9\u7f51\u7ad9\u7684\u4e0b\u8f7d\u9875\u9762\u4e2d\uff0c\u60a8\u53ef\u4ee5\u770b\u5230\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u7684\u4e0b\u8f7d\u94fe\u63a5\u3002\u5bf9\u4e8e\u5927\u591a\u6570\u7528\u6237\uff0c\u9009\u62e9\u9002\u5408\u81ea\u5df1\u64cd\u4f5c\u7cfb\u7edf\u7684\u6700\u65b0\u7a33\u5b9a\u7248\u672c\u5373\u53ef\u3002\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u53cc\u51fb\u5b89\u88c5\u5305\u5f00\u59cb\u5b89\u88c5\u3002\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u9009\u62e9\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u8fd9\u5c06\u81ea\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u4f7f\u5f97\u5728\u547d\u4ee4\u884c\u4e2d\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528Python\u547d\u4ee4\u3002<\/p>\n<\/p>\n<p><p>\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u662f\u786e\u4fddPython\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u7684\u5173\u952e\u6b65\u9aa4\u3002\u5982\u679c\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u6ca1\u6709\u9009\u62e9\u81ea\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u60a8\u9700\u8981\u624b\u52a8\u914d\u7f6e\u3002\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\u4e2d\u7684\u201c\u73af\u5883\u53d8\u91cf\u201d\u9009\u9879\u6765\u914d\u7f6e\uff1b\u5728Mac\u6216Linux\u7cfb\u7edf\u4e2d\uff0c\u9700\u8981\u7f16\u8f91\u76f8\u5e94\u7684shell\u914d\u7f6e\u6587\u4ef6\uff08\u5982.bashrc\u6216.zshrc\uff09\u3002<\/p>\n<\/p>\n<hr>\n<p><p>\u4e00\u3001\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9<\/p>\n<\/p>\n<p><p>Python\u5b98\u65b9\u7f51\u7ad9\u662f\u4e0b\u8f7dPython\u7684\u4e3b\u8981\u6765\u6e90\uff0c\u786e\u4fdd\u60a8\u4e0b\u8f7d\u7684\u662f\u5b98\u65b9\u7248\u672c\u4ee5\u907f\u514d\u5b89\u5168\u95ee\u9898\u3002\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165\u201cpython.org\u201d\uff0c\u8fdb\u5165\u5b98\u65b9\u7f51\u7ad9\u3002Python.org\u4e0d\u4ec5\u63d0\u4f9b\u4e86\u6700\u65b0\u7248\u672c\u7684\u4e0b\u8f7d\u94fe\u63a5\uff0c\u8fd8\u5305\u542b\u4e86\u4e30\u5bcc\u7684\u6587\u6863\u8d44\u6e90\uff0c\u5305\u62ec\u5b89\u88c5\u6307\u5357\u3001\u6559\u7a0b\u548cAPI\u53c2\u8003\u3002<\/p>\n<\/p>\n<p><p>\u5b98\u65b9\u7f51\u7ad9\u7684\u4e0b\u8f7d\u9875\u9762\u975e\u5e38\u76f4\u89c2\uff0c\u60a8\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u64cd\u4f5c\u7cfb\u7edf\u9009\u62e9\u5408\u9002\u7684\u7248\u672c\u3002\u901a\u5e38\uff0c\u5b98\u65b9\u7f51\u7ad9\u4f1a\u81ea\u52a8\u68c0\u6d4b\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u5e76\u63a8\u8350\u5408\u9002\u7684\u4e0b\u8f7d\u94fe\u63a5\u3002\u6b64\u5916\uff0c\u7f51\u7ad9\u4e0a\u8fd8\u63d0\u4f9b\u4e86\u4e0d\u540c\u7248\u672c\u7684\u5386\u53f2\u7248\u672c\u4e0b\u8f7d\u94fe\u63a5\uff0c\u4ee5\u4fbf\u9700\u8981\u7279\u5b9a\u7248\u672c\u7684\u7528\u6237\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><p>\u9009\u62e9\u5408\u9002\u7684Python\u7248\u672c\u662f\u4e0b\u8f7d\u7684\u5173\u952e\u6b65\u9aa4\u3002Python\u6709\u4e24\u4e2a\u4e3b\u8981\u7684\u7248\u672c\u7cfb\u5217\uff1aPython 2.x\u548cPython 3.x\u3002Python 2\u5df2\u7ecf\u505c\u6b62\u66f4\u65b0\uff0c\u56e0\u6b64\u5efa\u8bae\u65b0\u7528\u6237\u9009\u62e9Python 3\u3002\u5728\u4e0b\u8f7d\u9875\u9762\u4e0a\uff0c\u60a8\u53ef\u4ee5\u770b\u5230\u5f53\u524d\u6700\u65b0\u7684Python 3\u7248\u672c\uff0c\u901a\u5e38\u4e5f\u662f\u63a8\u8350\u7684\u4e0b\u8f7d\u7248\u672c\u3002\u9009\u62e9\u5408\u9002\u7684\u7248\u672c\u53ef\u4ee5\u786e\u4fdd\u60a8\u4f7f\u7528\u7684Python\u662f\u529f\u80fd\u6700\u5168\u4e14\u6700\u5b89\u5168\u7684\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u9009\u62e9\u5408\u9002\u7684Python\u7248\u672c<\/p>\n<\/p>\n<p><p>\u9009\u62e9\u5408\u9002\u7684Python\u7248\u672c\u662f\u786e\u4fdd\u60a8\u80fd\u591f\u987a\u5229\u4f7f\u7528Python\u7684\u5173\u952e\u56e0\u7d20\u3002Python 3.x\u662f\u5f53\u524d\u7684\u4e3b\u6d41\u7248\u672c\uff0c\u5e76\u4e14\u5927\u591a\u6570\u65b0\u7684\u5e93\u548c\u6846\u67b6\u90fd\u662f\u4e3aPython 3\u8bbe\u8ba1\u7684\u3002\u5982\u679c\u60a8\u662f\u65b0\u7528\u6237\uff0c\u5efa\u8bae\u9009\u62e9\u6700\u65b0\u7684Python 3\u7a33\u5b9a\u7248\u672c\u3002\u5bf9\u4e8e\u67d0\u4e9b\u7279\u5b9a\u7684\u5e94\u7528\u573a\u666f\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u7279\u5b9a\u7684Python\u7248\u672c\uff0c\u6b64\u65f6\u53ef\u4ee5\u53c2\u8003\u9879\u76ee\u7684\u8981\u6c42\u6216\u6587\u6863\u3002<\/p>\n<\/p>\n<p><p>Python\u7684\u7248\u672c\u66f4\u65b0\u76f8\u5bf9\u9891\u7e41\uff0c\u6bcf\u4e2a\u7248\u672c\u90fd\u4f1a\u5f15\u5165\u65b0\u7684\u7279\u6027\u548c\u6539\u8fdb\u3002\u56e0\u6b64\uff0c\u9009\u62e9\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u672c\u901a\u5e38\u662f\u4e00\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\uff0c\u56e0\u4e3a\u5b83\u5305\u542b\u4e86\u6700\u65b0\u7684\u529f\u80fd\u548c\u5b89\u5168\u8865\u4e01\u3002\u5728\u5b98\u65b9\u7f51\u7ad9\u7684\u4e0b\u8f7d\u9875\u9762\u4e2d\uff0c\u60a8\u53ef\u4ee5\u6e05\u6670\u5730\u770b\u5230\u6bcf\u4e2a\u7248\u672c\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5305\u62ec\u53d1\u5e03\u65e5\u671f\u3001\u7248\u672c\u53f7\u4ee5\u53ca\u4e3b\u8981\u66f4\u65b0\u5185\u5bb9\u3002<\/p>\n<\/p>\n<p><p>\u4e0b\u8f7d\u9002\u5408\u60a8\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\u4e5f\u662f\u975e\u5e38\u91cd\u8981\u7684\u4e00\u6b65\u3002Python\u5b98\u65b9\u7f51\u7ad9\u63d0\u4f9b\u4e86Windows\u3001Mac\u548cLinux\u7b49\u591a\u4e2a\u5e73\u53f0\u7684\u5b89\u88c5\u5305\u3002\u5bf9\u4e8eWindows\u7528\u6237\uff0c\u901a\u5e38\u53ef\u4ee5\u9009\u62e9\u201c.exe\u201d\u6216\u201c.msi\u201d\u683c\u5f0f\u7684\u5b89\u88c5\u5305\uff1bMac\u7528\u6237\u53ef\u4ee5\u9009\u62e9\u201c.pkg\u201d\u683c\u5f0f\u7684\u5b89\u88c5\u5305\uff1b\u800cLinux\u7528\u6237\u5219\u901a\u5e38\u4f7f\u7528\u6e90\u4ee3\u7801\u8fdb\u884c\u7f16\u8bd1\u6216\u901a\u8fc7\u5305\u7ba1\u7406\u5668\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u4e0b\u8f7d\u5e76\u5b89\u88c5Python<\/p>\n<\/p>\n<p><p>\u4e0b\u8f7dPython\u7684\u8fc7\u7a0b\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u9009\u62e9\u5408\u9002\u7684\u7248\u672c\u5e76\u70b9\u51fb\u4e0b\u8f7d\u94fe\u63a5\u5373\u53ef\u3002\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u60a8\u5c06\u83b7\u5f97\u4e00\u4e2a\u5b89\u88c5\u5305\u6587\u4ef6\u3002\u5728Windows\u548cMac\u7cfb\u7edf\u4e2d\uff0c\u5b89\u88c5\u5305\u901a\u5e38\u662f\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u53cc\u51fb\u5373\u53ef\u542f\u52a8\u5b89\u88c5\u7a0b\u5e8f\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u901a\u8fc7\u547d\u4ee4\u884c\u5de5\u5177\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p><p>\u5f00\u59cb\u5b89\u88c5\u540e\uff0c\u60a8\u5c06\u770b\u5230\u4e00\u4e2a\u5b89\u88c5\u5411\u5bfc\u9875\u9762\u3002\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u6709\u51e0\u4e2a\u5173\u952e\u6b65\u9aa4\u9700\u8981\u6ce8\u610f\u3002\u9996\u5148\uff0c\u60a8\u53ef\u4ee5\u9009\u62e9\u5b89\u88c5\u8def\u5f84\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cPython\u5c06\u5b89\u88c5\u5728\u7cfb\u7edf\u7684\u9ed8\u8ba4\u7a0b\u5e8f\u76ee\u5f55\u4e2d\u3002\u5982\u679c\u60a8\u5e0c\u671b\u5c06Python\u5b89\u88c5\u5728\u5176\u4ed6\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u5728\u6b64\u6b65\u9aa4\u4e2d\u8fdb\u884c\u66f4\u6539\u3002<\/p>\n<\/p>\n<p><p>\u5728\u5b89\u88c5\u9009\u9879\u9875\u9762\uff0c\u60a8\u4f1a\u770b\u5230\u201cAdd Python to PATH\u201d\u9009\u9879\u3002<strong>\u52fe\u9009\u6b64\u9009\u9879\u975e\u5e38\u91cd\u8981<\/strong>\uff0c\u56e0\u4e3a\u5b83\u5c06\u81ea\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u4f7f\u60a8\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u4f7f\u7528Python\u547d\u4ee4\u3002\u5982\u679c\u6ca1\u6709\u52fe\u9009\u6b64\u9009\u9879\uff0c\u60a8\u9700\u8981\u5728\u5b89\u88c5\u5b8c\u6210\u540e\u624b\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/p>\n<\/p>\n<p><p>\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u662f\u786e\u4fddPython\u80fd\u591f\u5728\u547d\u4ee4\u884c\u4e2d\u6b63\u5e38\u8fd0\u884c\u7684\u5173\u952e\u6b65\u9aa4\u3002\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u5982\u679c\u9009\u62e9\u4e86\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u5b89\u88c5\u7a0b\u5e8f\u5c06\u81ea\u52a8\u4e3a\u60a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3002\u5982\u679c\u6ca1\u6709\u9009\u62e9\u6b64\u9009\u9879\uff0c\u60a8\u9700\u8981\u624b\u52a8\u5b8c\u6210\u8fd9\u4e00\u6b65\u3002<\/p>\n<\/p>\n<p><p>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\u4e2d\u7684\u201c\u73af\u5883\u53d8\u91cf\u201d\u9009\u9879\u6765\u914d\u7f6e\u3002\u5728\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\u7a97\u53e3\u4e2d\uff0c\u627e\u5230\u201c\u73af\u5883\u53d8\u91cf\u201d\u6309\u94ae\uff0c\u7136\u540e\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u90e8\u5206\u627e\u5230\u5e76\u7f16\u8f91\u201cPath\u201d\u53d8\u91cf\u3002\u5728\u201cPath\u201d\u53d8\u91cf\u4e2d\uff0c\u6dfb\u52a0Python\u5b89\u88c5\u76ee\u5f55\u7684\u8def\u5f84\uff0c\u4f8b\u5982\u201cC:\\Python39\u201d\u3002<\/p>\n<\/p>\n<p><p>\u5728Mac\u6216Linux\u7cfb\u7edf\u4e2d\uff0c\u60a8\u9700\u8981\u7f16\u8f91shell\u914d\u7f6e\u6587\u4ef6\uff08\u5982.bashrc\u6216.zshrc\uff09\uff0c\u5e76\u6dfb\u52a0Python\u5b89\u88c5\u8def\u5f84\u5230PATH\u53d8\u91cf\u4e2d\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u884c\uff1a<code>export PATH=&quot;\/usr\/local\/bin\/python3:$PATH&quot;<\/code>\u3002\u4fdd\u5b58\u6587\u4ef6\u540e\uff0c\u8fd0\u884c<code>source ~\/.bashrc<\/code>\u6216<code>source ~\/.zshrc<\/code>\u4ee5\u4f7f\u66f4\u6539\u751f\u6548\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u9a8c\u8bc1Python\u5b89\u88c5<\/p>\n<\/p>\n<p><p>\u5b8c\u6210\u5b89\u88c5\u548c\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u5de5\u5177\u9a8c\u8bc1Python\u662f\u5426\u5b89\u88c5\u6210\u529f\u3002\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\uff0c\u5982\u679c\u8fd4\u56dePython\u7248\u672c\u4fe1\u606f\uff0c\u5219\u8868\u793a\u5b89\u88c5\u6210\u529f\u3002\u6b64\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u8f93\u5165<code>pip --version<\/code>\u6765\u9a8c\u8bc1pip\u662f\u5426\u6b63\u786e\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p><p>Pip\u662fPython\u7684\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u7528\u4e8e\u5b89\u88c5\u548c\u7ba1\u7406Python\u5e93\u548c\u4f9d\u8d56\u9879\u3002\u5728\u5b89\u88c5Python\u65f6\uff0cpip\u901a\u5e38\u4f1a\u81ea\u52a8\u5b89\u88c5\u3002\u5982\u679cpip\u672a\u5b89\u88c5\u6216\u65e0\u6cd5\u4f7f\u7528\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4<code>python -m ensurepip<\/code>\u8fdb\u884c\u624b\u52a8\u5b89\u88c5\u3002\u786e\u4fddpip\u53ef\u4ee5\u6b63\u5e38\u4f7f\u7528\u5bf9\u4e8e\u540e\u7eed\u5b89\u88c5Python\u5e93\u975e\u5e38\u91cd\u8981\u3002<\/p>\n<\/p>\n<p><p>\u9a8c\u8bc1\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u5f00\u59cb\u5728Python\u73af\u5883\u4e2d\u7f16\u5199\u4ee3\u7801\u3002Python\u63d0\u4f9b\u4e86\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u7684\u547d\u4ee4\u884c\u73af\u5883\uff0c\u79f0\u4e3aREPL\uff08Read-Eval-Print Loop\uff09\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\u8fdb\u5165\u6b64\u73af\u5883\u3002\u5728REPL\u4e2d\uff0c\u60a8\u53ef\u4ee5\u8f93\u5165Python\u4ee3\u7801\u5e76\u7acb\u5373\u67e5\u770b\u7ed3\u679c\uff0c\u8fd9\u5bf9\u4e8e\u5b66\u4e60\u548c\u6d4b\u8bd5\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001\u5b89\u88c5Python\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/p>\n<\/p>\n<p><p>\u867d\u7136\u60a8\u53ef\u4ee5\u5728\u4efb\u4f55\u6587\u672c\u7f16\u8f91\u5668\u4e2d\u7f16\u5199Python\u4ee3\u7801\uff0c\u4f46\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u53ef\u4ee5\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u3002IDE\u901a\u5e38\u63d0\u4f9b\u4ee3\u7801\u8865\u5168\u3001\u8bed\u6cd5\u9ad8\u4eae\u3001\u8c03\u8bd5\u5de5\u5177\u7b49\u529f\u80fd\uff0c\u5e2e\u52a9\u5f00\u53d1\u8005\u66f4\u5feb\u5730\u7f16\u5199\u548c\u8c03\u8bd5\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p>\u6709\u591a\u79cdPython IDE\u53ef\u4f9b\u9009\u62e9\uff0c\u5176\u4e2d\u6700\u6d41\u884c\u7684\u5305\u62ecPyCharm\u3001VS Code\u548cJupyter Notebook\u3002PyCharm\u662f\u4e13\u4e3aPython\u5f00\u53d1\u8bbe\u8ba1\u7684IDE\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\u548c\u63d2\u4ef6\u652f\u6301\u3002VS Code\u662f\u4e00\u6b3e\u8f7b\u91cf\u7ea7\u7684\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\uff0c\u5e76\u901a\u8fc7\u63d2\u4ef6\u6269\u5c55Python\u529f\u80fd\u3002Jupyter Notebook\u662f\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u7684\u5f00\u53d1\u73af\u5883\uff0c\u7279\u522b\u9002\u5408\u7528\u4e8e\u6570\u636e\u5206\u6790\u548c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u3002<\/p>\n<\/p>\n<p><p>\u9009\u62e9\u9002\u5408\u60a8\u7684IDE\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5\u3002\u5927\u591a\u6570IDE\u5728\u5b89\u88c5\u540e\u4f1a\u81ea\u52a8\u68c0\u6d4b\u7cfb\u7edf\u4e2d\u7684Python\u89e3\u91ca\u5668\uff0c\u5e76\u8fdb\u884c\u76f8\u5e94\u7684\u914d\u7f6e\u3002\u60a8\u53ef\u4ee5\u5728IDE\u4e2d\u521b\u5efa\u65b0\u7684Python\u9879\u76ee\u6216\u6253\u5f00\u5df2\u6709\u7684\u9879\u76ee\uff0c\u5f00\u59cb\u60a8\u7684Python\u7f16\u7a0b\u4e4b\u65c5\u3002<\/p>\n<\/p>\n<p><p>\u4e03\u3001\u4f7f\u7528Python\u7f16\u5199\u7b2c\u4e00\u4e2a\u7a0b\u5e8f<\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u5f00\u59cb\u4f7f\u7528Python\u7f16\u5199\u60a8\u7684\u7b2c\u4e00\u4e2a\u7a0b\u5e8f\u3002\u6253\u5f00\u60a8\u9009\u62e9\u7684IDE\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u6587\u4ef6\uff0c\u5e76\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4fdd\u5b58\u6587\u4ef6\u540e\uff0c\u8fd0\u884c\u7a0b\u5e8f\uff0c\u60a8\u5c06\u5728\u63a7\u5236\u53f0\u4e2d\u770b\u5230\u8f93\u51fa\u201cHello, World!\u201d\u3002\u8fd9\u6bb5\u4ee3\u7801\u6f14\u793a\u4e86Python\u7684\u7b80\u5355\u6613\u7528\u6027\uff0c\u5373\u4fbf\u662f\u7f16\u7a0b\u65b0\u624b\u4e5f\u80fd\u8f7b\u677e\u4e0a\u624b\u3002<\/p>\n<\/p>\n<p><p>\u5728\u7f16\u5199\u66f4\u591a\u590d\u6742\u7684\u7a0b\u5e8f\u4e4b\u524d\uff0c\u5efa\u8bae\u60a8\u719f\u6089Python\u7684\u57fa\u672c\u8bed\u6cd5\u548c\u6982\u5ff5\uff0c\u5305\u62ec\u53d8\u91cf\u3001\u6570\u636e\u7c7b\u578b\u3001\u63a7\u5236\u7ed3\u6784\uff08\u5982\u5faa\u73af\u548c\u6761\u4ef6\u8bed\u53e5\uff09\u3001\u51fd\u6570\u7b49\u3002\u901a\u8fc7\u5b66\u4e60\u548c\u5b9e\u8df5\uff0c\u60a8\u5c06\u80fd\u591f\u638c\u63e1Python\u7f16\u7a0b\uff0c\u5e76\u4e3a\u672a\u6765\u7684\u9879\u76ee\u6253\u4e0b\u575a\u5b9e\u7684\u57fa\u7840\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u9009\u62e9\u9002\u5408\u6211\u64cd\u4f5c\u7cfb\u7edf\u7684Python\u7248\u672c\uff1f<\/strong><br \/>\u5728\u4e0b\u8f7dPython\u65f6\uff0c\u9996\u5148\u9700\u8981\u786e\u8ba4\u4f60\u7684\u64cd\u4f5c\u7cfb\u7edf\u7c7b\u578b\uff0c\u4f8b\u5982Windows\u3001macOS\u8fd8\u662fLinux\u3002\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u9700\u8981\u4e0b\u8f7d\u76f8\u5e94\u7684Python\u7248\u672c\u3002\u5728Python\u5b98\u65b9\u7f51\u7ad9\u4e0a\uff0c\u901a\u5e38\u4f1a\u63d0\u4f9b\u9002\u7528\u4e8e\u5404\u5927\u7cfb\u7edf\u7684\u6700\u65b0\u7248\u672c\u4ee5\u53ca\u5386\u53f2\u7248\u672c\u7684\u4e0b\u8f7d\u94fe\u63a5\u3002\u786e\u4fdd\u9009\u62e9\u5408\u9002\u7684\u4f4d\u6570\uff0832\u4f4d\u621664\u4f4d\uff09\u4ee5\u786e\u4fdd\u6700\u4f73\u517c\u5bb9\u6027\u548c\u6027\u80fd\u3002<\/p>\n<p><strong>\u5b89\u88c5Python\u540e\uff0c\u5982\u4f55\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\uff1f<\/strong><br \/>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u4e2d\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\u6765\u9a8c\u8bc1Python\u662f\u5426\u6b63\u786e\u5b89\u88c5\u3002\u5982\u679c\u770b\u5230\u76f8\u5e94\u7684\u7248\u672c\u53f7\uff0c\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002\u5982\u679c\u51fa\u73b0\u9519\u8bef\u4fe1\u606f\uff0c\u53ef\u80fd\u9700\u8981\u68c0\u67e5\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u6216\u91cd\u65b0\u5b89\u88c5\u3002<\/p>\n<p><strong>\u5728\u65b0\u7535\u8111\u4e0a\u5b89\u88c5Python\u540e\uff0c\u5982\u4f55\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93\uff1f<\/strong><br \/>\u5b89\u88c5Python\u540e\uff0c\u4f7f\u7528<code>pip<\/code>\uff08Python\u7684\u5305\u7ba1\u7406\u5de5\u5177\uff09\u53ef\u4ee5\u8f7b\u677e\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93\u3002\u6253\u5f00\u547d\u4ee4\u884c\uff0c\u8f93\u5165<code>pip install package_name<\/code>\uff0c\u5c06<code>package_name<\/code>\u66ff\u6362\u4e3a\u4f60\u9700\u8981\u5b89\u88c5\u7684\u5e93\u540d\uff0c\u4f8b\u5982<code>numpy<\/code>\u6216<code>requests<\/code>\u3002\u786e\u4fdd\u7f51\u7edc\u8fde\u63a5\u6b63\u5e38\uff0c\u5b89\u88c5\u8fc7\u7a0b\u4f1a\u81ea\u52a8\u4e0b\u8f7d\u548c\u5b89\u88c5\u6240\u9700\u7684\u5e93\u53ca\u5176\u4f9d\u8d56\u9879\u3002\u82e5\u51fa\u73b0\u6743\u9650\u95ee\u9898\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4f7f\u7528<code>sudo<\/code>\u547d\u4ee4\u6216\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884c\u547d\u4ee4\u884c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u65b0\u7535\u8111\u4e0b\u8f7dPython\u7684\u6b65\u9aa4\u4e3b\u8981\u5305\u62ec\uff1a\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\u3001\u9009\u62e9\u5408\u9002\u7684Python\u7248\u672c\u3001\u4e0b\u8f7d\u5e76\u5b89\u88c5Pyth [&hellip;]","protected":false},"author":3,"featured_media":984904,"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\/984895"}],"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=984895"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/984895\/revisions"}],"predecessor-version":[{"id":984905,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/984895\/revisions\/984905"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/984904"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=984895"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=984895"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=984895"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}