{"id":995983,"date":"2024-12-27T09:09:24","date_gmt":"2024-12-27T01:09:24","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/995983.html"},"modified":"2024-12-27T09:09:27","modified_gmt":"2024-12-27T01:09:27","slug":"python%e8%a7%a3%e9%87%8a%e5%99%a8%e5%a6%82%e4%bd%95%e6%b7%bb%e5%8a%a0","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/995983.html","title":{"rendered":"python\u89e3\u91ca\u5668\u5982\u4f55\u6dfb\u52a0"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25072404\/2531ac5f-bddb-44da-ba86-ea62704d3dd6.webp\" alt=\"python\u89e3\u91ca\u5668\u5982\u4f55\u6dfb\u52a0\" \/><\/p>\n<p><p> <strong>\u8981\u5728\u7cfb\u7edf\u4e2d\u6dfb\u52a0Python\u89e3\u91ca\u5668\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\uff1a\u4e0b\u8f7d\u5e76\u5b89\u88c5\u5b98\u65b9Python\u53d1\u884c\u7248\u3001\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177\u5b89\u88c5\u3001\u8bbe\u7f6e\u865a\u62df\u73af\u5883\u3001\u6dfb\u52a0\u5230\u73af\u5883\u53d8\u91cf\u3002<\/strong>\u5176\u4e2d\uff0c\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4e0b\u8f7d\u5e76\u5b89\u88c5\u5b98\u65b9Python\u53d1\u884c\u7248\u3002Python\u5b98\u7f51\u63d0\u4f9b\u4e86\u9002\u7528\u4e8e\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u7684Python\u5b89\u88c5\u7a0b\u5e8f\uff0c\u7528\u6237\u53ea\u9700\u9009\u62e9\u9002\u5408\u81ea\u5df1\u7cfb\u7edf\u7684\u7248\u672c\u8fdb\u884c\u4e0b\u8f7d\u5e76\u5b89\u88c5\u5373\u53ef\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u901a\u8fc7\u5b89\u88c5Python\u53d1\u884c\u7248\u7684\u65b9\u6cd5\u6765\u6dfb\u52a0Python\u89e3\u91ca\u5668\u3002<\/p>\n<\/p>\n<p><p>\u5b89\u88c5Python\u53d1\u884c\u7248\u662f\u6700\u76f4\u63a5\u548c\u7b80\u5355\u7684\u65b9\u6cd5\u4e4b\u4e00\u3002\u9996\u5148\uff0c\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.python.org\/%EF%BC%89%EF%BC%8C%E5%9C%A8%E4%B8%8B%E8%BD%BD%E9%A1%B5%E9%9D%A2%E9%80%89%E6%8B%A9%E9%80%82%E5%90%88%E4%BD%A0%E7%9A%84%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E7%9A%84Python%E7%89%88%E6%9C%AC%E3%80%82%E9%80%9A%E5%B8%B8%E4%BC%9A%E6%9C%89Windows%E3%80%81macOS%E5%92%8CLinux%E7%89%88%E6%9C%AC%E5%8F%AF%E4%BE%9B%E9%80%89%E6%8B%A9%E3%80%82%E4%B8%8B%E8%BD%BD%E5%AE%8C%E6%88%90%E5%90%8E%EF%BC%8C%E8%BF%90%E8%A1%8C%E5%AE%89%E8%A3%85%E7%A8%8B%E5%BA%8F%EF%BC%8C%E5%B9%B6%E6%8C%89%E7%85%A7%E5%90%91%E5%AF%BC%E5%AE%8C%E6%88%90%E5%AE%89%E8%A3%85%E3%80%82%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B%E4%B8%AD%EF%BC%8C%E7%A1%AE%E4%BF%9D%E5%8B%BE%E9%80%89%E2%80%9CAdd\">https:\/\/www.python.org\/\uff09\uff0c\u5728\u4e0b\u8f7d\u9875\u9762\u9009\u62e9\u9002\u5408\u4f60\u7684\u64cd\u4f5c\u7cfb\u7edf\u7684Python\u7248\u672c\u3002\u901a\u5e38\u4f1a\u6709Windows\u3001macOS\u548cLinux\u7248\u672c\u53ef\u4f9b\u9009\u62e9\u3002\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\uff0c\u5e76\u6309\u7167\u5411\u5bfc\u5b8c\u6210\u5b89\u88c5\u3002\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u786e\u4fdd\u52fe\u9009\u201cAdd<\/a> Python to PATH\u201d\u9009\u9879\uff0c\u4ee5\u4fbf\u5c06Python\u6dfb\u52a0\u5230\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\u4e2d\uff0c\u8fd9\u6837\u5728\u547d\u4ee4\u884c\u4e2d\u5c31\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528Python\u547d\u4ee4\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4e0b\u8f7d\u5e76\u5b89\u88c5\u5b98\u65b9Python\u53d1\u884c\u7248<\/p>\n<\/p>\n<p><p>Python\u7684\u5b98\u65b9\u7f51\u7ad9\u4e3a\u7528\u6237\u63d0\u4f9b\u4e86\u5404\u79cd\u7248\u672c\u7684Python\u4f9b\u4e0b\u8f7d\u4f7f\u7528\u3002\u901a\u8fc7\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff0c\u4f60\u53ef\u4ee5\u627e\u5230\u9002\u5408\u81ea\u5df1\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\u3002\u9009\u62e9\u6b63\u786e\u7684\u7248\u672c\u540e\uff0c\u70b9\u51fb\u4e0b\u8f7d\u5e76\u8fdb\u884c\u5b89\u88c5\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u786e\u4fdd\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u8fd9\u6837\u53ef\u4ee5\u65b9\u4fbf\u540e\u7eed\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u4f7f\u7528Python\u547d\u4ee4\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4e0b\u8f7dPython\u5b89\u88c5\u5305<\/li>\n<\/ol>\n<p><p>\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.python.org\/%EF%BC%89%EF%BC%8C%E5%9C%A8%E4%B8%8B%E8%BD%BD%E9%A1%B5%E9%9D%A2%E9%80%89%E6%8B%A9%E9%80%82%E5%90%88%E4%BD%A0%E7%9A%84%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E7%9A%84Python%E7%89%88%E6%9C%AC%E3%80%82%E9%80%9A%E5%B8%B8%E4%BC%9A%E6%9C%89Windows%E3%80%81macOS%E5%92%8CLinux%E7%89%88%E6%9C%AC%E5%8F%AF%E4%BE%9B%E9%80%89%E6%8B%A9%E3%80%82%E9%80%89%E6%8B%A9%E5%90%88%E9%80%82%E7%9A%84%E7%89%88%E6%9C%AC%E5%90%8E%EF%BC%8C%E7%82%B9%E5%87%BB%E4%B8%8B%E8%BD%BD%E6%8C%89%E9%92%AE%E3%80%82\">https:\/\/www.python.org\/\uff09\uff0c\u5728\u4e0b\u8f7d\u9875\u9762\u9009\u62e9\u9002\u5408\u4f60\u7684\u64cd\u4f5c\u7cfb\u7edf\u7684Python\u7248\u672c\u3002\u901a\u5e38\u4f1a\u6709Windows\u3001macOS\u548cLinux\u7248\u672c\u53ef\u4f9b\u9009\u62e9\u3002\u9009\u62e9\u5408\u9002\u7684\u7248\u672c\u540e\uff0c\u70b9\u51fb\u4e0b\u8f7d\u6309\u94ae\u3002<\/a><\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u5b89\u88c5Python<\/li>\n<\/ol>\n<p><p>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u53cc\u51fb\u5b89\u88c5\u5305\u6587\u4ef6\uff0c\u542f\u52a8\u5b89\u88c5\u7a0b\u5e8f\u3002\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u5efa\u8bae\u9009\u62e9\u201cCustom installation\u201d\u9009\u9879\uff0c\u4ee5\u4fbf\u53ef\u4ee5\u81ea\u5b9a\u4e49\u5b89\u88c5\u8def\u5f84\u548c\u7ec4\u4ef6\u3002\u5728\u201cOptional Features\u201d\u754c\u9762\uff0c\u786e\u4fdd\u52fe\u9009\u201cpip\u201d\u548c\u201cAdd Python to PATH\u201d\u9009\u9879\u3002\u5b8c\u6210\u5b89\u88c5\u540e\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u201cpython &#8211;version\u201d\u6765\u9a8c\u8bc1Python\u662f\u5426\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177\u5b89\u88c5<\/p>\n<\/p>\n<p><p>\u5bf9\u4e8eLinux\u7528\u6237\u6765\u8bf4\uff0c\u53ef\u4ee5\u901a\u8fc7\u5305\u7ba1\u7406\u5de5\u5177\u6765\u5b89\u88c5Python\uff0c\u8fd9\u662f\u4e00\u79cd\u66f4\u4e3a\u4fbf\u6377\u7684\u65b9\u6cd5\u3002\u5e38\u89c1\u7684\u5305\u7ba1\u7406\u5de5\u5177\u6709apt\u3001yum\u7b49\u3002\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177\u5b89\u88c5Python\u65f6\uff0c\u901a\u5e38\u53ea\u9700\u4e00\u6761\u547d\u4ee4\u5373\u53ef\u5b8c\u6210\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4f7f\u7528apt\u5305\u7ba1\u7406\u5668\uff08\u9002\u7528\u4e8eDebian\u7cfbLinux\uff09<\/li>\n<\/ol>\n<p><p>\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u66f4\u65b0\u5305\u5217\u8868\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo apt update<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5Python\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo apt install python3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528yum\u5305\u7ba1\u7406\u5668\uff08\u9002\u7528\u4e8eRed Hat\u7cfbLinux\uff09<\/li>\n<\/ol>\n<p><p>\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5Python\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo yum install python3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u8bbe\u7f6e\u865a\u62df\u73af\u5883<\/p>\n<\/p>\n<p><p>\u865a\u62df\u73af\u5883\u53ef\u4ee5\u4e3a\u6bcf\u4e2a\u9879\u76ee\u521b\u5efa\u4e00\u4e2a\u72ec\u7acb\u7684Python\u73af\u5883\uff0c\u907f\u514d\u4e0d\u540c\u9879\u76ee\u4e4b\u95f4\u7684\u4f9d\u8d56\u51b2\u7a81\u3002\u5728\u8bbe\u7f6e\u865a\u62df\u73af\u5883\u4e4b\u524d\uff0c\u9700\u8981\u786e\u4fdd\u7cfb\u7edf\u4e2d\u5df2\u5b89\u88c5Python\u548cpip\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5virtualenv<\/li>\n<\/ol>\n<p><p>\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5virtualenv\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install virtualenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u521b\u5efa\u865a\u62df\u73af\u5883<\/li>\n<\/ol>\n<p><p>\u8fdb\u5165\u9879\u76ee\u76ee\u5f55\u540e\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u521b\u5efa\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">virtualenv myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5176\u4e2d\u201cmyenv\u201d\u662f\u865a\u62df\u73af\u5883\u7684\u540d\u79f0\u3002\u521b\u5efa\u5b8c\u6210\u540e\uff0c\u6fc0\u6d3b\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u5728Windows\u4e2d\uff0c\u8f93\u5165\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">myenv\\Scripts\\activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5728macOS\u548cLinux\u4e2d\uff0c\u8f93\u5165\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">source myenv\/bin\/activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u56db\u3001\u6dfb\u52a0\u5230\u73af\u5883\u53d8\u91cf<\/p>\n<\/p>\n<p><p>\u5b89\u88c5Python\u540e\uff0c\u53ef\u80fd\u9700\u8981\u624b\u52a8\u5c06Python\u7684\u5b89\u88c5\u8def\u5f84\u6dfb\u52a0\u5230\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\u4e2d\uff0c\u4ee5\u4fbf\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u4f7f\u7528Python\u547d\u4ee4\u3002<\/p>\n<\/p>\n<ol>\n<li>\u6dfb\u52a0\u5230Windows\u73af\u5883\u53d8\u91cf<\/li>\n<\/ol>\n<p><p>\u53f3\u952e\u70b9\u51fb\u201c\u6b64\u7535\u8111\u201d\u6216\u201c\u6211\u7684\u7535\u8111\u201d\uff0c\u9009\u62e9\u201c\u5c5e\u6027\u201d\uff0c\u8fdb\u5165\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\uff0c\u70b9\u51fb\u201c\u73af\u5883\u53d8\u91cf\u201d\u6309\u94ae\u3002\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u90e8\u5206\uff0c\u627e\u5230\u201cPath\u201d\u53d8\u91cf\uff0c\u70b9\u51fb\u201c\u7f16\u8f91\u201d\u6309\u94ae\uff0c\u5c06Python\u7684\u5b89\u88c5\u8def\u5f84\u6dfb\u52a0\u5230\u53d8\u91cf\u503c\u4e2d\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u6dfb\u52a0\u5230macOS\u548cLinux\u73af\u5883\u53d8\u91cf<\/li>\n<\/ol>\n<p><p>\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u7f16\u8f91.bashrc\u6216.zshrc\u6587\u4ef6\uff08\u6839\u636e\u4f7f\u7528\u7684shell\u4e0d\u540c\uff09\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">nano ~\/.bashrc<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0\u4ee5\u4e0b\u884c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">export PATH=&quot;\/usr\/local\/bin\/python3:$PATH&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4fdd\u5b58\u5e76\u5173\u95ed\u6587\u4ef6\u540e\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u4f7f\u66f4\u6539\u751f\u6548\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">source ~\/.bashrc<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u6210\u529f\u5730\u5728\u7cfb\u7edf\u4e2d\u6dfb\u52a0Python\u89e3\u91ca\u5668\uff0c\u5e76\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u4f7f\u7528Python\u547d\u4ee4\u8fdb\u884c\u5f00\u53d1\u548c\u8fd0\u884cPython\u7a0b\u5e8f\u3002\u65e0\u8bba\u662f\u4e0b\u8f7d\u5e76\u5b89\u88c5\u5b98\u65b9Python\u53d1\u884c\u7248\u3001\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u8fd8\u662f\u8bbe\u7f6e\u865a\u62df\u73af\u5883\uff0c\u8fd9\u4e9b\u65b9\u6cd5\u90fd\u80fd\u5e2e\u52a9\u4f60\u7075\u6d3b\u5730\u7ba1\u7406\u548c\u4f7f\u7528Python\u89e3\u91ca\u5668\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728\u6211\u7684\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5Python\u89e3\u91ca\u5668\uff1f<\/strong><br \/>\u5b89\u88c5Python\u89e3\u91ca\u5668\u7684\u6b65\u9aa4\u53d6\u51b3\u4e8e\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u3002\u5bf9\u4e8eWindows\u7528\u6237\uff0c\u53ef\u4ee5\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff08python.org\uff09\uff0c\u4e0b\u8f7d\u9002\u5408\u60a8\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\uff0c\u5e76\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5b89\u88c5\u3002macOS\u7528\u6237\u53ef\u4ee5\u901a\u8fc7Homebrew\u8fdb\u884c\u5b89\u88c5\uff0c\u547d\u4ee4\u4e3a<code>brew install python<\/code>\u3002Linux\u7528\u6237\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7\u5305\u7ba1\u7406\u5668\u5b89\u88c5\uff0c\u4f8b\u5982\u4f7f\u7528<code>sudo apt-get install python3<\/code>\u3002\u5b89\u88c5\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u8f93\u5165<code>python --version<\/code>\u6765\u9a8c\u8bc1\u662f\u5426\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<p><strong>Python\u89e3\u91ca\u5668\u7684\u4e0d\u540c\u7248\u672c\u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/strong><br \/>Python\u6709\u591a\u4e2a\u7248\u672c\uff0c\u6700\u5e38\u7528\u7684\u5305\u62ecPython 2.x\u548cPython 3.x\u3002Python 2.x\u5df2\u7ecf\u57282020\u5e74\u505c\u6b62\u652f\u6301\uff0c\u56e0\u6b64\u5efa\u8bae\u65b0\u7528\u6237\u548c\u9879\u76ee\u9009\u62e9Python 3.x\u7248\u672c\u3002\u4e3b\u8981\u7684\u533a\u522b\u5728\u4e8e\u8bed\u8a00\u7684\u8bed\u6cd5\u3001\u6807\u51c6\u5e93\u4ee5\u53ca\u7279\u6027\u3002\u4f8b\u5982\uff0cPython 3\u5f15\u5165\u4e86\u8bb8\u591a\u65b0\u7684\u7279\u6027\uff0c\u5982\u7c7b\u578b\u6ce8\u89e3\u3001\u5f02\u6b65\u7f16\u7a0b\u7b49\uff0c\u4e14\u67d0\u4e9bPython 2\u7684\u7279\u6027\u57283.x\u4e2d\u5df2\u88ab\u5220\u9664\u6216\u4fee\u6539\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u4f7f\u7528\u4e0d\u540c\u7684\u89e3\u91ca\u5668\uff1f<\/strong><br \/>\u5982\u679c\u60a8\u9700\u8981\u5728\u540c\u4e00\u53f0\u8ba1\u7b97\u673a\u4e0a\u4f7f\u7528\u591a\u4e2aPython\u7248\u672c\uff0c\u53ef\u4ee5\u4f7f\u7528\u865a\u62df\u73af\u5883\u5de5\u5177\uff0c\u6bd4\u5982<code>venv<\/code>\u6216<code>virtualenv<\/code>\u3002\u8fd9\u4e9b\u5de5\u5177\u5141\u8bb8\u60a8\u4e3a\u6bcf\u4e2a\u9879\u76ee\u521b\u5efa\u72ec\u7acb\u7684\u73af\u5883\uff0c\u4ece\u800c\u907f\u514d\u5305\u548c\u4f9d\u8d56\u51b2\u7a81\u3002\u521b\u5efa\u865a\u62df\u73af\u5883\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u6fc0\u6d3b\u76f8\u5e94\u7684\u73af\u5883\u6765\u4f7f\u7528\u7279\u5b9a\u7248\u672c\u7684Python\u89e3\u91ca\u5668\uff0c\u786e\u4fdd\u5728\u9879\u76ee\u95f4\u5207\u6362\u65f6\u4e0d\u4f1a\u5f71\u54cd\u5176\u4ed6\u9879\u76ee\u7684\u4f9d\u8d56\u3002<\/p>\n<p><strong>\u4f7f\u7528Python\u89e3\u91ca\u5668\u65f6\uff0c\u5982\u4f55\u9009\u62e9\u5408\u9002\u7684IDE\u6216\u7f16\u8f91\u5668\uff1f<\/strong><br \/>\u9009\u62e9\u5408\u9002\u7684IDE\u6216\u7f16\u8f91\u5668\u53ef\u4ee5\u63d0\u9ad8\u60a8\u7684\u5f00\u53d1\u6548\u7387\u3002\u5e38\u89c1\u7684\u9009\u9879\u5305\u62ecPyCharm\u3001Visual Studio Code\u3001Jupyter Notebook\u7b49\u3002PyCharm\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\uff0c\u9002\u5408\u5927\u578b\u9879\u76ee\uff1bVisual Studio Code\u8f7b\u91cf\u4e14\u53ef\u6269\u5c55\uff0c\u9002\u5408\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\uff1bJupyter Notebook\u5219\u66f4\u9002\u5408\u6570\u636e\u79d1\u5b66\u548c\u4ea4\u4e92\u5f0f\u7f16\u7a0b\u3002\u6839\u636e\u60a8\u7684\u9700\u6c42\u548c\u9879\u76ee\u7c7b\u578b\u9009\u62e9\u6700\u5408\u9002\u7684\u5de5\u5177\u53ef\u4ee5\u5e2e\u52a9\u60a8\u66f4\u9ad8\u6548\u5730\u4f7f\u7528Python\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728\u7cfb\u7edf\u4e2d\u6dfb\u52a0Python\u89e3\u91ca\u5668\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\uff1a\u4e0b\u8f7d\u5e76\u5b89\u88c5\u5b98\u65b9Python\u53d1\u884c\u7248\u3001\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177\u5b89\u88c5\u3001 [&hellip;]","protected":false},"author":3,"featured_media":995987,"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\/995983"}],"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=995983"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/995983\/revisions"}],"predecessor-version":[{"id":995988,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/995983\/revisions\/995988"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/995987"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=995983"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=995983"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=995983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}