{"id":1002948,"date":"2024-12-27T10:13:10","date_gmt":"2024-12-27T02:13:10","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1002948.html"},"modified":"2024-12-27T10:13:12","modified_gmt":"2024-12-27T02:13:12","slug":"%e5%a6%82%e4%bd%95%e4%b8%8b%e8%bd%bdpython2-7-13","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1002948.html","title":{"rendered":"\u5982\u4f55\u4e0b\u8f7dpython2.7.13"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25080516\/1ded6b86-359c-4457-8b28-fbc36b927eef.webp\" alt=\"\u5982\u4f55\u4e0b\u8f7dpython2.7.13\" \/><\/p>\n<p><p> <strong>\u8981\u4e0b\u8f7dPython 2.7.13\uff0c\u60a8\u53ef\u4ee5\u8bbf\u95eePython\u5b98\u65b9\u7684\u5386\u53f2\u7248\u672c\u9875\u9762\u3001\u9009\u62e9\u9002\u5408\u60a8\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\u6216\u6e90\u7801\u3001\u5e76\u9075\u5faa\u5b89\u88c5\u8bf4\u660e\u8fdb\u884c\u5b89\u88c5\u3002<\/strong>\u5c3d\u7ba1Python 2\u7cfb\u5217\u5df2\u7ecf\u4e0d\u518d\u53d7\u5230\u5b98\u65b9\u652f\u6301\uff0c\u4f46\u5728\u67d0\u4e9b\u9057\u7559\u9879\u76ee\u4e2d\uff0c\u53ef\u80fd\u4ecd\u9700\u8981\u4f7f\u7528\u65e7\u7248\u672c\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u4e0b\u8f7d\u548c\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4e0b\u8f7dPython 2.7.13<\/h3>\n<\/p>\n<p><h4>1. \u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.python.org%EF%BC%89%E3%80%82%E5%9C%A8%E7%BD%91%E7%AB%99%E7%9A%84%E9%A6%96%E9%A1%B5%EF%BC%8C%E6%82%A8%E5%8F%AF%E4%BB%A5%E6%89%BE%E5%88%B0%22Downloads%22%E9%80%89%E9%A1%B9%EF%BC%8C%E7%82%B9%E5%87%BB%E5%90%8E%E9%80%89%E6%8B%A9%E2%80%9CView\">https:\/\/www.python.org\uff09\u3002\u5728\u7f51\u7ad9\u7684\u9996\u9875\uff0c\u60a8\u53ef\u4ee5\u627e\u5230&quot;Downloads&quot;\u9009\u9879\uff0c\u70b9\u51fb\u540e\u9009\u62e9\u201cView<\/a> the full list of downloads\u201d\u3002<\/p>\n<\/p>\n<p><h4>2. \u5bfb\u627e\u5386\u53f2\u7248\u672c<\/h4>\n<\/p>\n<p><p>\u5728\u4e0b\u8f7d\u9875\u9762\uff0c\u627e\u5230\u201cLooking for a specific release?\u201d\u6216\u8005\u76f4\u63a5\u8bbf\u95ee<a href=\"https:\/\/www.python.org\/ftp\/python\/%E3%80%82%E5%9C%A8%E8%BF%99%E9%87%8C%EF%BC%8C%E6%82%A8%E5%8F%AF%E4%BB%A5%E6%89%BE%E5%88%B0%E6%89%80%E6%9C%89%E5%8E%86%E5%8F%B2%E7%89%88%E6%9C%AC%E7%9A%84Python%E3%80%82\">https:\/\/www.python.org\/ftp\/python\/\u3002\u5728\u8fd9\u91cc\uff0c\u60a8\u53ef\u4ee5\u627e\u5230\u6240\u6709\u5386\u53f2\u7248\u672c\u7684Python\u3002<\/a><\/p>\n<\/p>\n<p><h4>3. \u9009\u62e92.7.13\u7248\u672c<\/h4>\n<\/p>\n<p><p>\u5728\u5386\u53f2\u7248\u672c\u5217\u8868\u4e2d\uff0c\u627e\u52302.7.13\u7248\u672c\u3002\u70b9\u51fb\u8fdb\u5165\u7248\u672c\u9875\u9762\uff0c\u60a8\u4f1a\u770b\u5230\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\u4ee5\u53ca\u6e90\u4ee3\u7801\u3002\u9009\u62e9\u9002\u5408\u60a8\u64cd\u4f5c\u7cfb\u7edf\u7684\u6587\u4ef6\u8fdb\u884c\u4e0b\u8f7d\u3002<\/p>\n<\/p>\n<p><h4>4. \u4e0b\u8f7d\u5bf9\u5e94\u7684\u5b89\u88c5\u5305<\/h4>\n<\/p>\n<p><p>\u5bf9\u4e8eWindows\u7528\u6237\uff0c\u901a\u5e38\u662f\u4ee5\u201c.msi\u201d\u6216\u201c.exe\u201d\u7ed3\u5c3e\u7684\u6587\u4ef6\uff1b\u5bf9\u4e8emacOS\u7528\u6237\uff0c\u901a\u5e38\u662f\u201c.dmg\u201d\u6587\u4ef6\uff1b\u5bf9\u4e8eLinux\u7528\u6237\uff0c\u5efa\u8bae\u4e0b\u8f7d\u6e90\u7801\u6587\u4ef6\uff08\u201c.tgz\u201d\u6216\u201c.tar.xz\u201d\uff09\u4ee5\u4fbf\u81ea\u884c\u7f16\u8bd1\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u5b89\u88c5Python 2.7.13<\/h3>\n<\/p>\n<p><h4>1. Windows\u7cfb\u7edf\u5b89\u88c5<\/h4>\n<\/p>\n<p><p>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u53cc\u51fb\u5b89\u88c5\u5305\u5e76\u6309\u7167\u6307\u793a\u8fdb\u884c\u5b89\u88c5\u3002<strong>\u786e\u4fdd\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9009\u62e9\u6dfb\u52a0Python\u5230\u7cfb\u7edf\u8def\u5f84\uff08Add Python to PATH\uff09\uff0c\u8fd9\u6837\u53ef\u4ee5\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u76f4\u63a5\u4f7f\u7528Python\u547d\u4ee4\u3002<\/strong><\/p>\n<\/p>\n<p><h4>2. macOS\u7cfb\u7edf\u5b89\u88c5<\/h4>\n<\/p>\n<p><p>\u5bf9\u4e8emacOS\u7528\u6237\uff0c\u4e0b\u8f7d\u201c.dmg\u201d\u6587\u4ef6\u540e\uff0c\u53cc\u51fb\u6253\u5f00\u5e76\u62d6\u52a8Python\u56fe\u6807\u5230\u201cApplications\u201d\u6587\u4ef6\u5939\u4e2d\u8fdb\u884c\u5b89\u88c5\u3002\u5b89\u88c5\u540e\uff0c\u53ef\u4ee5\u5728\u7ec8\u7aef\u4e2d\u901a\u8fc7<code>python<\/code>\u547d\u4ee4\u6765\u9a8c\u8bc1\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p><h4>3. Linux\u7cfb\u7edf\u5b89\u88c5<\/h4>\n<\/p>\n<p><p>Linux\u7528\u6237\u9700\u8981\u89e3\u538b\u7f29\u4e0b\u8f7d\u7684\u6e90\u7801\u5305\uff0c\u7136\u540e\u901a\u8fc7\u547d\u4ee4\u884c\u7f16\u8bd1\u548c\u5b89\u88c5\u3002\u901a\u5e38\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">tar -xf Python-2.7.13.tar.xz<\/p>\n<p>cd Python-2.7.13<\/p>\n<p>.\/configure<\/p>\n<p>make<\/p>\n<p>sudo make install<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u6307\u5b9a\u5b89\u88c5\u8def\u5f84\u6216\u542f\u7528\u7279\u5b9a\u7684\u7f16\u8bd1\u9009\u9879\u6765\u5b9a\u5236Python\u7684\u5b89\u88c5\u3002<\/strong><\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u9a8c\u8bc1\u5b89\u88c5<\/h3>\n<\/p>\n<p><p>\u65e0\u8bba\u60a8\u4f7f\u7528\u54ea\u79cd\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5b89\u88c5\u5b8c\u6210\u540e\u90fd\u9700\u8981\u9a8c\u8bc1Python\u662f\u5426\u6b63\u786e\u5b89\u88c5\u3002\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u663e\u793a\u4e3aPython 2.7.13\uff0c\u5219\u8868\u793a\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u914d\u7f6e\u4e0e\u6ce8\u610f\u4e8b\u9879<\/h3>\n<\/p>\n<p><h4>1. \u73af\u5883\u53d8\u91cf\u914d\u7f6e<\/h4>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u624b\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3002\u786e\u4fddPython\u7684\u5b89\u88c5\u8def\u5f84\u5df2\u88ab\u6dfb\u52a0\u5230\u7cfb\u7edf\u7684PATH\u53d8\u91cf\u4e2d\uff0c\u8fd9\u6837\u53ef\u4ee5\u5728\u4efb\u4f55\u5730\u65b9\u4f7f\u7528Python\u547d\u4ee4\u3002<\/p>\n<\/p>\n<p><h4>2. \u5b89\u88c5pip<\/h4>\n<\/p>\n<p><p>\u867d\u7136Python 2.7.13\u53ef\u80fd\u9ed8\u8ba4\u9644\u5e26pip\uff0c\u4f46\u5982\u679c\u6ca1\u6709\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5pip\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">wget https:\/\/bootstrap.pypa.io\/get-pip.py<\/p>\n<p>python get-pip.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u786e\u4fddpip\u7248\u672c\u9002\u7528\u4e8ePython 2.7\uff0c\u5e76\u4e14\u53ef\u4ee5\u6b63\u786e\u5b89\u88c5\u65e7\u7248\u672c\u7684Python\u5305\u3002<\/p>\n<\/p>\n<p><h4>3. \u4f7f\u7528\u865a\u62df\u73af\u5883<\/h4>\n<\/p>\n<p><p>\u4e3a\u4e86\u907f\u514d\u4e0e\u5176\u4ed6Python\u7248\u672c\u7684\u51b2\u7a81\uff0c\u5efa\u8bae\u4f7f\u7528\u865a\u62df\u73af\u5883\uff08virtualenv\uff09\u6765\u7ba1\u7406Python 2.7.13\u7684\u9879\u76ee\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5virtualenv\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install virtualenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u521b\u5efa\u5e76\u6fc0\u6d3b\u4e00\u4e2a\u65b0\u7684\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">virtualenv my_project_env<\/p>\n<p>source my_project_env\/bin\/activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u4f7f\u7528\u865a\u62df\u73af\u5883\u53ef\u4ee5\u786e\u4fdd\u9879\u76ee\u7684\u4f9d\u8d56\u4e0d\u4f1a\u5f71\u54cd\u5168\u5c40\u7684Python\u73af\u5883\u3002<\/strong><\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u5e38\u89c1\u95ee\u9898\u89e3\u51b3<\/h3>\n<\/p>\n<p><h4>1. \u7f16\u8bd1\u9519\u8bef<\/h4>\n<\/p>\n<p><p>\u5728Linux\u7cfb\u7edf\u4e0a\u7f16\u8bd1Python\u6e90\u7801\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u7f3a\u5c11\u4f9d\u8d56\u7684\u95ee\u9898\u3002\u786e\u4fdd\u5b89\u88c5\u4e86\u5fc5\u9700\u7684\u5f00\u53d1\u5de5\u5177\u548c\u5e93\uff0c\u4f8b\u5982<code>build-essential<\/code>\u3001<code>libssl-dev<\/code>\u3001<code>libreadline-dev<\/code>\u7b49\u3002<\/p>\n<\/p>\n<p><h4>2. \u517c\u5bb9\u6027\u95ee\u9898<\/h4>\n<\/p>\n<p><p>\u7531\u4e8ePython 2.7.13\u5df2\u4e0d\u518d\u66f4\u65b0\uff0c\u67d0\u4e9b\u73b0\u4ee3\u7684\u5e93\u548c\u5de5\u5177\u53ef\u80fd\u4e0d\u518d\u652f\u6301\u6b64\u7248\u672c\u3002\u786e\u4fdd\u4f7f\u7528\u517c\u5bb9\u7684\u65e7\u7248\u672c\u5e93\uff0c\u5e76\u8003\u8651\u9010\u6b65\u8fc1\u79fb\u5230Python 3\u4ee5\u83b7\u5f97\u66f4\u597d\u7684\u652f\u6301\u548c\u6027\u80fd\u3002<\/p>\n<\/p>\n<p><h4>3. \u591aPython\u7248\u672c\u7ba1\u7406<\/h4>\n<\/p>\n<p><p>\u5728\u540c\u4e00\u7cfb\u7edf\u4e0a\u540c\u65f6\u5b89\u88c5\u591a\u4e2aPython\u7248\u672c\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u5de5\u5177\u5982<code>pyenv<\/code>\u6765\u7ba1\u7406\u4e0d\u540c\u7248\u672c\u7684Python\uff0c\u5e76\u5728\u4e0d\u540c\u9879\u76ee\u4e4b\u95f4\u5207\u6362\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u60a8\u53ef\u4ee5\u6210\u529f\u4e0b\u8f7d\u5e76\u5b89\u88c5Python 2.7.13\uff0c\u5e76\u5728\u9700\u8981\u7684\u9879\u76ee\u4e2d\u8fdb\u884c\u4f7f\u7528\u3002\u8bf7\u6ce8\u610f\uff0c\u7531\u4e8ePython 2.7\u5df2\u505c\u6b62\u5b98\u65b9\u652f\u6301\uff0c\u5e94\u5c3d\u53ef\u80fd\u8ba1\u5212\u8fc1\u79fb\u5230Python 3\u4ee5\u83b7\u5f97\u66f4\u597d\u7684\u5b89\u5168\u6027\u548c\u529f\u80fd\u652f\u6301\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u4e0b\u8f7dPython 2.7.13\u7684\u6700\u4f73\u9014\u5f84\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u60a8\u53ef\u4ee5\u901a\u8fc7\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff08python.org\uff09\u627e\u5230Python 2.7.13\u7684\u4e0b\u8f7d\u94fe\u63a5\u3002\u5728\u7f51\u7ad9\u7684\u4e0b\u8f7d\u9875\u9762\u4e2d\uff0c\u627e\u5230\u5bf9\u5e94\u7248\u672c\u7684\u94fe\u63a5\u5e76\u9009\u62e9\u9002\u5408\u60a8\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\u8fdb\u884c\u4e0b\u8f7d\u3002\u540c\u65f6\uff0c\u4e5f\u53ef\u4ee5\u5728\u4e00\u4e9b\u5f00\u6e90\u8f6f\u4ef6\u7684\u955c\u50cf\u7f51\u7ad9\u4e0a\u627e\u5230\u8fd9\u4e2a\u7248\u672c\u7684\u4e0b\u8f7d\u9009\u9879\u3002<\/p>\n<p><strong>Python 2.7.13\u662f\u5426\u4ecd\u7136\u63a8\u8350\u4f7f\u7528\uff1f<\/strong><br \/>\u5c3d\u7ba1Python 2.7.13\u5728\u8fc7\u53bb\u662f\u4e00\u4e2a\u975e\u5e38\u6d41\u884c\u7684\u7248\u672c\uff0c\u4f46\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u81ea2020\u5e741\u6708\u8d77\uff0cPython 2\u5df2\u7ecf\u505c\u6b62\u652f\u6301\u3002\u8fd9\u610f\u5473\u7740\u4e0d\u518d\u6709\u5b89\u5168\u66f4\u65b0\u548c\u529f\u80fd\u6539\u8fdb\u3002\u56e0\u6b64\uff0c\u5982\u679c\u60a8\u6b63\u5728\u8003\u8651\u65b0\u9879\u76ee\u6216\u957f\u671f\u7ef4\u62a4\u7684\u9879\u76ee\uff0c\u5efa\u8bae\u4f7f\u7528Python 3.x\u7cfb\u5217\uff0c\u4ee5\u4eab\u53d7\u66f4\u597d\u7684\u652f\u6301\u548c\u65b0\u7279\u6027\u3002<\/p>\n<p><strong>\u5b89\u88c5Python 2.7.13\u65f6\u9700\u8981\u6ce8\u610f\u54ea\u4e9b\u4e8b\u9879\uff1f<\/strong><br \/>\u5728\u5b89\u88c5Python 2.7.13\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e0e\u8be5\u7248\u672c\u517c\u5bb9\u3002\u5b89\u88c5\u8fc7\u7a0b\u901a\u5e38\u4f1a\u6d89\u53ca\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u4ee5\u786e\u4fdd\u60a8\u80fd\u591f\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528Python\u547d\u4ee4\u3002\u6b64\u5916\uff0c\u67d0\u4e9b\u4f9d\u8d56\u5e93\u53ef\u80fd\u9700\u8981\u624b\u52a8\u5b89\u88c5\uff0c\u7279\u522b\u662f\u5728Linux\u7cfb\u7edf\u4e0a\u3002\u56e0\u6b64\uff0c\u4ed4\u7ec6\u9605\u8bfb\u5b89\u88c5\u6307\u5357\u548c\u76f8\u5173\u6587\u6863\u5c06\u6709\u52a9\u4e8e\u987a\u5229\u5b8c\u6210\u5b89\u88c5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u4e0b\u8f7dPython 2.7.13\uff0c\u60a8\u53ef\u4ee5\u8bbf\u95eePython\u5b98\u65b9\u7684\u5386\u53f2\u7248\u672c\u9875\u9762\u3001\u9009\u62e9\u9002\u5408\u60a8\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\u6216\u6e90\u7801\u3001 [&hellip;]","protected":false},"author":3,"featured_media":1002959,"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\/1002948"}],"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=1002948"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1002948\/revisions"}],"predecessor-version":[{"id":1002960,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1002948\/revisions\/1002960"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1002959"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1002948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1002948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1002948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}