{"id":995882,"date":"2024-12-27T09:08:36","date_gmt":"2024-12-27T01:08:36","guid":{"rendered":""},"modified":"2024-12-27T09:08:38","modified_gmt":"2024-12-27T01:08:38","slug":"%e5%a6%82%e4%bd%95%e4%b8%8b%e8%bd%bdpython3-8","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/995882.html","title":{"rendered":"\u5982\u4f55\u4e0b\u8f7dpython3.8"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25072318\/7d24e0af-88f8-4152-b992-e74c825ee229.webp\" alt=\"\u5982\u4f55\u4e0b\u8f7dpython3.8\" \/><\/p>\n<p><p> <strong>\u8981\u4e0b\u8f7dPython 3.8\uff0c\u4f60\u53ef\u4ee5\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\u3001\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177\u3001\u6216\u8005\u901a\u8fc7\u7b2c\u4e09\u65b9\u5e73\u53f0\u8fdb\u884c\u4e0b\u8f7d\u548c\u5b89\u88c5\u3002<\/strong> \u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u76f4\u63a5\u4ecePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u9002\u7528\u4e8e\u4f60\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\uff0c\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u4e0b\u8f7d\u7684\u662f\u5b98\u65b9\u53d1\u5e03\u7684\u7248\u672c\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4ece\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u548c\u5b89\u88c5Python 3.8\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4ecePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9<\/strong><\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6253\u5f00\u4f60\u7684\u6d4f\u89c8\u5668\uff0c\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff1a<a href=\"https:\/\/www.python.org%E3%80%82%E5%9C%A8%E9%A6%96%E9%A1%B5%E7%9A%84%E5%AF%BC%E8%88%AA%E6%A0%8F%E4%B8%AD%EF%BC%8C%E7%82%B9%E5%87%BB%E2%80%9CDownloads%E2%80%9D%E9%80%89%E9%A1%B9%E3%80%82\">https:\/\/www.python.org\u3002\u5728\u9996\u9875\u7684\u5bfc\u822a\u680f\u4e2d\uff0c\u70b9\u51fb\u201cDownloads\u201d\u9009\u9879\u3002<\/a><\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9009\u62e9Python 3.8\u7248\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u4e0b\u8f7d\u9875\u9762\u4e0a\uff0c\u4f60\u53ef\u4ee5\u770b\u5230\u4e0d\u540c\u7248\u672c\u7684Python\u3002\u70b9\u51fb\u201cView the full list of downloads\u201d\u94fe\u63a5\uff0c\u67e5\u627ePython 3.8\u7684\u53d1\u5e03\u7248\u672c\u3002\u901a\u5e38\uff0c\u4f60\u4f1a\u770b\u5230\u4e00\u7cfb\u5217\u7684\u7248\u672c\u66f4\u65b0\u8bb0\u5f55\u3002\u9009\u62e9\u6700\u65b0\u76843.8.x\u7248\u672c\u4ee5\u83b7\u5f97\u6700\u65b0\u7684\u5b89\u5168\u548c\u529f\u80fd\u66f4\u65b0\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9009\u62e9\u9002\u5408\u7684\u64cd\u4f5c\u7cfb\u7edf<\/strong><\/p>\n<\/p>\n<p><p>\u6839\u636e\u4f60\u7684\u64cd\u4f5c\u7cfb\u7edf\uff08Windows\u3001macOS\u3001Linux\u7b49\uff09\uff0c\u9009\u62e9\u76f8\u5e94\u7684\u5b89\u88c5\u5305\u8fdb\u884c\u4e0b\u8f7d\u3002\u5bf9\u4e8eWindows\u7528\u6237\uff0c\u901a\u5e38\u9009\u62e9\u201c.exe\u201d\u5b89\u88c5\u6587\u4ef6\uff1b\u5bf9\u4e8emacOS\u7528\u6237\uff0c\u9009\u62e9\u201c.pkg\u201d\u6587\u4ef6\uff1b\u800cLinux\u7528\u6237\u5219\u53ef\u4ee5\u4f7f\u7528\u6e90\u4ee3\u7801\u8fdb\u884c\u7f16\u8bd1\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4e0b\u8f7d\u5e76\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f<\/strong><\/p>\n<\/p>\n<p><p>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u8fd0\u884c\u5b89\u88c5\u6587\u4ef6\u3002\u5bf9\u4e8eWindows\u7528\u6237\uff0c\u786e\u4fdd\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\u4ee5\u4fbf\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u4f7f\u7528Python\u3002\u7136\u540e\uff0c\u6309\u7167\u5b89\u88c5\u5411\u5bfc\u7684\u6307\u793a\u5b8c\u6210\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e8c\u3001\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177\u5b89\u88c5<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528Homebrew\uff08macOS\uff09<\/strong><\/p>\n<\/p>\n<p><p>\u5bf9\u4e8emacOS\u7528\u6237\uff0c\u53ef\u4ee5\u4f7f\u7528Homebrew\u6765\u5b89\u88c5Python 3.8\u3002\u9996\u5148\uff0c\u786e\u4fddHomebrew\u5df2\u7ecf\u5b89\u88c5\u3002\u7136\u540e\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">brew install python@3.8<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u81ea\u52a8\u4e0b\u8f7d\u5e76\u5b89\u88c5Python 3.8\uff0c\u540c\u65f6\u5904\u7406\u6240\u6709\u4f9d\u8d56\u5173\u7cfb\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528apt-get\uff08Ubuntu\/Debian\uff09<\/strong><\/p>\n<\/p>\n<p><p>\u5728Ubuntu\u6216Debian\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528apt-get\u547d\u4ee4\u6765\u5b89\u88c5Python 3.8\u3002\u9996\u5148\uff0c\u66f4\u65b0\u4f60\u7684\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\u5b89\u88c5Python 3.8\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo apt install python3.8<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528yum\/dnf\uff08CentOS\/Fedora\uff09<\/strong><\/p>\n<\/p>\n<p><p>\u5bf9\u4e8eCentOS\u6216Fedora\u7528\u6237\uff0c\u53ef\u4ee5\u4f7f\u7528yum\u6216dnf\u6765\u5b89\u88c5Python 3.8\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo yum install python38<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216\u8005<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo dnf install python38<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e09\u3001\u901a\u8fc7\u7b2c\u4e09\u65b9\u5e73\u53f0\u4e0b\u8f7d<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528Anaconda<\/strong><\/p>\n<\/p>\n<p><p>Anaconda\u662f\u4e00\u4e2a\u975e\u5e38\u6d41\u884c\u7684Python\u53d1\u884c\u7248\uff0c\u7279\u522b\u9002\u5408\u6570\u636e\u79d1\u5b66\u548c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u3002\u4e0b\u8f7dAnaconda\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7conda\u547d\u4ee4\u5b89\u88c5Python 3.8\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda create -n myenv python=3.8<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a\u201cmyenv\u201d\u7684\u65b0\u73af\u5883\uff0c\u5e76\u5728\u5176\u4e2d\u5b89\u88c5Python 3.8\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528Pyenv<\/strong><\/p>\n<\/p>\n<p><p>Pyenv\u662f\u4e00\u4e2a\u5f3a\u5927\u7684Python\u7248\u672c\u7ba1\u7406\u5de5\u5177\uff0c\u5141\u8bb8\u4f60\u5728\u540c\u4e00\u7cfb\u7edf\u4e0a\u5b89\u88c5\u548c\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c\u3002\u9996\u5148\uff0c\u5b89\u88c5Pyenv\uff0c\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5Python 3.8\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pyenv install 3.8.10<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u4e0b\u8f7d\u5e76\u7f16\u8bd1Python 3.8.10\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u56db\u3001\u5b89\u88c5\u540e\u7684\u914d\u7f6e<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong><\/p>\n<\/p>\n<p><p>\u65e0\u8bba\u4f7f\u7528\u54ea\u79cd\u65b9\u6cd5\u5b89\u88c5Python 3.8\uff0c\u5b8c\u6210\u540e\u90fd\u5e94\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002\u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3.8 --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5e94\u8be5\u8f93\u51faPython 3.8\u7684\u7248\u672c\u4fe1\u606f\uff0c\u786e\u8ba4\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u5728Windows\u4e0a\u5b89\u88c5\uff0c\u53ef\u80fd\u9700\u8981\u624b\u52a8\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u3002\u786e\u4fddPython\u7684\u5b89\u88c5\u8def\u5f84\u5df2\u6dfb\u52a0\u5230\u7cfb\u7edf\u7684PATH\u53d8\u91cf\u4e2d\uff0c\u4ee5\u4fbf\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u8c03\u7528Python\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5pip\u5305\u7ba1\u7406\u5668<\/strong><\/p>\n<\/p>\n<p><p>Python 3.8\u901a\u5e38\u81ea\u5e26pip\u5305\u7ba1\u7406\u5668\uff0c\u4f46\u5982\u679c\u6ca1\u6709\uff0c\u53ef\u4ee5\u624b\u52a8\u5b89\u88c5\u3002\u4e0b\u8f7dget-pip.py\u811a\u672c\u5e76\u8fd0\u884c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3.8 get-pip.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u5b89\u88c5pip\uff0c\u65b9\u4fbf\u4f60\u5728Python\u73af\u5883\u4e2d\u5b89\u88c5\u5176\u4ed6\u5305\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u914d\u7f6e\u865a\u62df\u73af\u5883<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528Python\u7684venv\u6a21\u5757\u521b\u5efa\u865a\u62df\u73af\u5883\uff0c\u4ee5\u4fbf\u5728\u9694\u79bb\u7684\u73af\u5883\u4e2d\u7ba1\u7406\u9879\u76ee\u7684\u4f9d\u8d56\u5173\u7cfb\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3.8 -m venv myproject<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fdb\u5165\u865a\u62df\u73af\u5883\u540e\uff0c\u4f60\u53ef\u4ee5\u81ea\u7531\u5b89\u88c5\u548c\u7ba1\u7406\u9879\u76ee\u6240\u9700\u7684\u5e93\uff0c\u800c\u4e0d\u5f71\u54cd\u7cfb\u7edf\u7684Python\u73af\u5883\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u6210\u529f\u4e0b\u8f7d\u5e76\u5b89\u88c5Python 3.8\uff0c\u5e76\u914d\u7f6e\u4e00\u4e2a\u9002\u5408\u5f00\u53d1\u7684\u73af\u5883\u3002\u65e0\u8bba\u662f\u4f7f\u7528\u5b98\u65b9\u5b89\u88c5\u5305\u3001\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u8fd8\u662f\u7b2c\u4e09\u65b9\u5e73\u53f0\uff0c\u90fd\u53ef\u4ee5\u6839\u636e\u4f60\u7684\u9700\u6c42\u9009\u62e9\u6700\u9002\u5408\u7684\u65b9\u6cd5\u3002\u5e0c\u671b\u8fd9\u7bc7\u6307\u5357\u80fd\u591f\u5e2e\u52a9\u4f60\u987a\u5229\u5b8c\u6210Python 3.8\u7684\u4e0b\u8f7d\u4e0e\u5b89\u88c5\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 3.8\u7248\u672c\uff1f<\/strong><br \/>\u5728\u4e0b\u8f7dPython 3.8\u65f6\uff0c\u786e\u4fdd\u9009\u62e9\u4e0e\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u517c\u5bb9\u7684\u7248\u672c\u3002\u53ef\u4ee5\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff0c\u5728\u4e0b\u8f7d\u9875\u9762\u4e0a\u4f1a\u5217\u51fa\u5404\u4e2a\u64cd\u4f5c\u7cfb\u7edf\uff08\u5982Windows\u3001macOS\u3001Linux\u7b49\uff09\u6240\u9700\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002\u6839\u636e\u81ea\u5df1\u7684\u64cd\u4f5c\u7cfb\u7edf\u7c7b\u578b\uff0c\u4e0b\u8f7d\u5bf9\u5e94\u7684\u5b89\u88c5\u5305\u3002<\/p>\n<p><strong>\u4e0b\u8f7dPython 3.8\u540e\uff0c\u5982\u4f55\u8fdb\u884c\u5b89\u88c5\uff1f<\/strong><br \/>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u53cc\u51fb\u5b89\u88c5\u5305\u4ee5\u5f00\u59cb\u5b89\u88c5\u8fc7\u7a0b\u3002\u5728\u5b89\u88c5\u5411\u5bfc\u4e2d\uff0c\u5efa\u8bae\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u8fd9\u5c06\u4f7f\u60a8\u5728\u547d\u4ee4\u884c\u4e2d\u80fd\u591f\u76f4\u63a5\u4f7f\u7528Python\u3002\u63a5\u4e0b\u6765\uff0c\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5b89\u88c5\u5373\u53ef\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python --version<\/code>\u6765\u786e\u8ba4\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002<\/p>\n<p><strong>\u5982\u679c\u6211\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9047\u5230\u95ee\u9898\uff0c\u8be5\u5982\u4f55\u89e3\u51b3\uff1f<\/strong><br \/>\u5982\u679c\u5728\u5b89\u88c5Python 3.8\u65f6\u9047\u5230\u95ee\u9898\uff0c\u53ef\u4ee5\u67e5\u770bPython\u5b98\u65b9\u7f51\u7ad9\u7684\u6587\u6863\u6216\u793e\u533a\u8bba\u575b\uff0c\u901a\u5e38\u4f1a\u6709\u8be6\u7ec6\u7684\u89e3\u51b3\u65b9\u6848\u3002\u53e6\u5916\uff0c\u786e\u4fdd\u60a8\u7684\u8ba1\u7b97\u673a\u6ee1\u8db3Python 3.8\u7684\u7cfb\u7edf\u8981\u6c42\uff0c\u5e76\u68c0\u67e5\u662f\u5426\u6709\u5176\u4ed6\u8f6f\u4ef6\u51b2\u7a81\u3002\u82e5\u95ee\u9898\u4f9d\u7136\u5b58\u5728\uff0c\u53ef\u4ee5\u8003\u8651\u91cd\u65b0\u4e0b\u8f7d\u5e76\u5b89\u88c5\uff0c\u6216\u8005\u5c1d\u8bd5\u4f7f\u7528\u865a\u62df\u73af\u5883\u7ba1\u7406\u5de5\u5177\u5982Anaconda\uff0c\u8fd9\u53ef\u4ee5\u5e2e\u52a9\u7b80\u5316Python\u7684\u7ba1\u7406\u548c\u5b89\u88c5\u8fc7\u7a0b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u4e0b\u8f7dPython 3.8\uff0c\u4f60\u53ef\u4ee5\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\u3001\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177\u3001\u6216\u8005\u901a\u8fc7\u7b2c\u4e09\u65b9\u5e73\u53f0\u8fdb\u884c\u4e0b\u8f7d\u548c\u5b89\u88c5\u3002 [&hellip;]","protected":false},"author":3,"featured_media":995888,"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\/995882"}],"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=995882"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/995882\/revisions"}],"predecessor-version":[{"id":995892,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/995882\/revisions\/995892"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/995888"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=995882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=995882"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=995882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}