{"id":1001979,"date":"2024-12-27T10:04:48","date_gmt":"2024-12-27T02:04:48","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1001979.html"},"modified":"2024-12-27T10:04:50","modified_gmt":"2024-12-27T02:04:50","slug":"%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%85python3-8-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1001979.html","title":{"rendered":"\u5982\u4f55\u5b89\u88c5python3.8.2"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25075922\/3cfe43c8-86df-4ce2-a524-a6e7dad0a78d.webp\" alt=\"\u5982\u4f55\u5b89\u88c5python3.8.2\" \/><\/p>\n<p><p> <strong>\u8981\u5b89\u88c5Python 3.8.2\uff0c\u60a8\u9700\u8981\u786e\u5b9a\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u3001\u4e0b\u8f7d\u9002\u5408\u7684\u5b89\u88c5\u5305\u3001\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u3001\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/strong>\u3002\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728Windows\u3001macOS\u548cLinux\u4e0a\u5b89\u88c5Python 3.8.2\uff0c\u5e76\u63d0\u4f9b\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6848\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001WINDOWS\u7cfb\u7edf\u4e0b\u5b89\u88c5PYTHON 3.8.2<\/p>\n<\/p>\n<p><p>\u5728Windows\u7cfb\u7edf\u4e0a\u5b89\u88c5Python 3.8.2\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\u5373\u53ef\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4e0b\u8f7dPython\u5b89\u88c5\u5305<\/strong><\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.python.org\/%EF%BC%89%EF%BC%8C%E7%84%B6%E5%90%8E%E5%AF%BC%E8%88%AA%E5%88%B0%E2%80%9CDownloads%E2%80%9D%E9%83%A8%E5%88%86%E3%80%82%E5%9C%A8%E8%BF%99%E9%87%8C%EF%BC%8C%E6%82%A8%E5%8F%AF%E4%BB%A5%E7%9C%8B%E5%88%B0%E6%9C%80%E6%96%B0%E7%9A%84Python%E7%89%88%E6%9C%AC%E5%8F%91%E5%B8%83%E3%80%82%E4%B8%BA%E4%BA%86%E4%B8%8B%E8%BD%BDPython\">https:\/\/www.python.org\/\uff09\uff0c\u7136\u540e\u5bfc\u822a\u5230\u201cDownloads\u201d\u90e8\u5206\u3002\u5728\u8fd9\u91cc\uff0c\u60a8\u53ef\u4ee5\u770b\u5230\u6700\u65b0\u7684Python\u7248\u672c\u53d1\u5e03\u3002\u4e3a\u4e86\u4e0b\u8f7dPython<\/a> 3.8.2\uff0c\u60a8\u9700\u8981\u70b9\u51fb\u201cView full list of downloads\u201d\u3002\u5728\u9875\u9762\u4e2d\u627e\u52303.8.2\u7248\u672c\u7684\u4e0b\u8f7d\u94fe\u63a5\uff0c\u5e76\u9009\u62e9\u9002\u5408Windows\u7684\u5b89\u88c5\u7a0b\u5e8f\uff08\u901a\u5e38\u4e3a\u201cWindows x86-64 executable installer\u201d\uff09\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f<\/strong><\/p>\n<\/p>\n<p><p>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u53cc\u51fb\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u3002\u5728\u5b89\u88c5\u5411\u5bfc\u754c\u9762\uff0c\u60a8\u4f1a\u770b\u5230\u4e00\u4e2a\u9009\u62e9\u6846\u201cAdd Python 3.8 to PATH\u201d\uff0c\u4e00\u5b9a\u8981\u52fe\u9009\u5b83\u3002\u8fd9\u6837\u505a\u4f1a\u81ea\u52a8\u5c06Python\u6dfb\u52a0\u5230\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u4e2d\uff0c\u4fbf\u4e8e\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u76f4\u63a5\u8fd0\u884cPython\u547d\u4ee4\u3002\u7136\u540e\uff0c\u70b9\u51fb\u201cInstall Now\u201d\u5f00\u59cb\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong><\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u6253\u5f00\u201c\u547d\u4ee4\u63d0\u793a\u7b26\u201d\uff08CMD\uff09\uff0c\u8f93\u5165<code>python --version<\/code>\uff0c\u5982\u679c\u5b89\u88c5\u6210\u529f\uff0c\u60a8\u5e94\u8be5\u770b\u5230Python 3.8.2\u7684\u7248\u672c\u4fe1\u606f\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\uff08\u53ef\u9009\uff09<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u60a8\u5fd8\u8bb0\u5728\u5b89\u88c5\u65f6\u6dfb\u52a0Python\u5230PATH\u4e2d\uff0c\u60a8\u53ef\u4ee5\u624b\u52a8\u6dfb\u52a0\u3002\u53f3\u952e\u5355\u51fb\u201c\u6b64\u7535\u8111\u201d\uff0c\u9009\u62e9\u201c\u5c5e\u6027\u201d-&gt;\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d-&gt;\u201c\u73af\u5883\u53d8\u91cf\u201d\uff0c\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u4e2d\u627e\u5230\u201cPath\u201d\uff0c\u70b9\u51fb\u201c\u7f16\u8f91\u201d\uff0c\u5c06Python\u7684\u5b89\u88c5\u8def\u5f84\uff08\u4f8b\u5982C:\\Python38\\\uff09\u6dfb\u52a0\u8fdb\u53bb\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001MACOS\u7cfb\u7edf\u4e0b\u5b89\u88c5PYTHON 3.8.2<\/p>\n<\/p>\n<p><p>\u5728macOS\u4e2d\u5b89\u88c5Python 3.8.2\u540c\u6837\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u8fc7\u7a0b\uff0c\u4ee5\u4e0b\u662f\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528Homebrew\u5b89\u88c5<\/strong><\/p>\n<\/p>\n<p><p>\u5bf9\u4e8emacOS\u7528\u6237\uff0cHomebrew\u662f\u4e00\u4e2a\u975e\u5e38\u65b9\u4fbf\u7684\u5305\u7ba1\u7406\u5668\u3002\u9996\u5148\uff0c\u786e\u4fdd\u60a8\u5df2\u7ecf\u5b89\u88c5\u4e86Homebrew\u3002\u6253\u5f00\u201c\u7ec8\u7aef\u201d\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5Python 3.8.2\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\u5b89\u88c5Python 3.8.2\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong><\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>python3.8 --version<\/code>\u6765\u9a8c\u8bc1\u5b89\u88c5\u3002\u5982\u679c\u4e00\u5207\u987a\u5229\uff0c\u60a8\u5c06\u770b\u52303.8.2\u7248\u672c\u4fe1\u606f\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8bbe\u7f6e\u9ed8\u8ba4Python\u7248\u672c\uff08\u53ef\u9009\uff09<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u5e0c\u671b\u5c06Python 3.8.2\u8bbe\u7f6e\u4e3a\u9ed8\u8ba4\u7248\u672c\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">echo &#39;export PATH=&quot;\/usr\/local\/opt\/python@3.8\/bin:$PATH&quot;&#39; &gt;&gt; ~\/.bash_profile<\/p>\n<p>source ~\/.bash_profile<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06Python 3.8.2\u6dfb\u52a0\u5230\u60a8\u7684PATH\u4e2d\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001LINUX\u7cfb\u7edf\u4e0b\u5b89\u88c5PYTHON 3.8.2<\/p>\n<\/p>\n<p><p>\u5728Linux\u7cfb\u7edf\u4e0a\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u6e90\u4ee3\u7801\u7f16\u8bd1\u5b89\u88c5Python 3.8.2\u3002\u4ee5\u4e0b\u662f\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5\u4f9d\u8d56<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u786e\u4fdd\u6240\u6709\u5fc5\u8981\u7684\u4f9d\u8d56\u90fd\u5df2\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo apt update<\/p>\n<p>sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4e0b\u8f7dPython\u6e90\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<p><p>\u8bbf\u95eePython\u5b98\u7f51\uff0c\u4e0b\u8f7dPython 3.8.2\u7684\u6e90\u4ee3\u7801\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">curl -O https:\/\/www.python.org\/ftp\/python\/3.8.2\/Python-3.8.2.tgz<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u89e3\u538b\u548c\u7f16\u8bd1<\/strong><\/p>\n<\/p>\n<p><p>\u89e3\u538b\u4e0b\u8f7d\u7684\u6587\u4ef6\uff0c\u5e76\u7f16\u8bd1\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">tar -xf Python-3.8.2.tgz<\/p>\n<p>cd Python-3.8.2<\/p>\n<p>.\/configure --enable-optimizations<\/p>\n<p>make -j $(nproc)<\/p>\n<p>sudo make altinstall<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f7f\u7528<code>make -j $(nproc)<\/code>\u53ef\u4ee5\u52a0\u5feb\u7f16\u8bd1\u8fc7\u7a0b\uff0c\u5176\u4e2d<code>$(nproc)<\/code>\u4f1a\u6839\u636e\u60a8\u7684CPU\u6838\u5fc3\u6570\u81ea\u52a8\u8c03\u6574\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong><\/p>\n<\/p>\n<p><p>\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u8fd0\u884c<code>python3.8 --version<\/code>\u6765\u68c0\u67e5\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u5e38\u89c1\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6848<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9047\u5230\u6743\u9650\u95ee\u9898<\/strong><\/p>\n<\/p>\n<p><p>\u5728Linux\u548cmacOS\u4e0a\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u4f7f\u7528<code>sudo<\/code>\u6765\u83b7\u5f97\u7ba1\u7406\u5458\u6743\u9650\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u65e0\u6cd5\u8bc6\u522bPython\u547d\u4ee4<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u7cfb\u7edf\u63d0\u793a\u627e\u4e0d\u5230Python\u547d\u4ee4\uff0c\u53ef\u80fd\u662f\u56e0\u4e3aPython\u6ca1\u6709\u6b63\u786e\u6dfb\u52a0\u5230\u73af\u5883\u53d8\u91cf\u4e2d\u3002\u8bf7\u68c0\u67e5\u5e76\u786e\u4fddPATH\u53d8\u91cf\u4e2d\u5305\u542b\u4e86Python\u7684\u5b89\u88c5\u8def\u5f84\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u591a\u7248\u672c\u5171\u5b58\u95ee\u9898<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u4e00\u4e9b\u7cfb\u7edf\u4e2d\uff0c\u53ef\u80fd\u5df2\u7ecf\u5b89\u88c5\u4e86\u5176\u4ed6\u7248\u672c\u7684Python\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u865a\u62df\u73af\u5883\uff08venv\uff09\u6765\u7ba1\u7406\u4e0d\u540c\u9879\u76ee\u6240\u9700\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u603b\u7ed3\u6765\u8bf4\uff0c\u5b89\u88c5Python 3.8.2\u7684\u8fc7\u7a0b\u76f8\u5bf9\u7b80\u5355\uff0c\u53ea\u9700\u6839\u636e\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u5373\u53ef\u3002\u901a\u8fc7\u9075\u5faa\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u60a8\u5e94\u8be5\u80fd\u591f\u987a\u5229\u5b8c\u6210\u5b89\u88c5\uff0c\u5e76\u5f00\u59cb\u4f7f\u7528Python\u8fdb\u884c\u5f00\u53d1\u5de5\u4f5c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Windows\u4e0a\u5b89\u88c5Python 3.8.2\uff1f<\/strong><br \/>\u5728Windows\u7cfb\u7edf\u4e2d\u5b89\u88c5Python 3.8.2\uff0c\u53ef\u4ee5\u4ecePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u76f8\u5e94\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002\u8bbf\u95ee\u5b98\u7f51\u540e\uff0c\u9009\u62e9\u201cDownloads\u201d\u90e8\u5206\uff0c\u627e\u5230Python 3.8.2\u7248\u672c\u5e76\u4e0b\u8f7d\u9002\u5408\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\u3002\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\uff0c\u786e\u4fdd\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u7136\u540e\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5b89\u88c5\u3002<\/p>\n<p><strong>\u5728macOS\u4e0a\u5b89\u88c5Python 3.8.2\u7684\u6b65\u9aa4\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u5bf9\u4e8emacOS\u7528\u6237\uff0c\u5b89\u88c5Python 3.8.2\u7684\u6700\u7b80\u4fbf\u65b9\u5f0f\u662f\u4f7f\u7528Homebrew\u3002\u9996\u5148\uff0c\u786e\u4fdd\u60a8\u7684\u7cfb\u7edf\u4e2d\u5b89\u88c5\u4e86Homebrew\uff0c\u6253\u5f00\u7ec8\u7aef\u5e76\u8f93\u5165<code>brew install python@3.8<\/code>\u3002\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7<code>python3.8 --version<\/code>\u547d\u4ee4\u6765\u786e\u8ba4\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002<\/p>\n<p><strong>Linux\u7cfb\u7edf\u5982\u4f55\u5b89\u88c5Python 3.8.2\uff1f<\/strong><br \/>\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u6765\u5b89\u88c5Python 3.8.2\u3002\u5bf9\u4e8eUbuntu\u7528\u6237\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<code>sudo apt update<\/code>\uff0c\u7136\u540e\u4f7f\u7528<code>sudo apt install python3.8<\/code>\u3002\u786e\u4fdd\u5728\u5b89\u88c5\u524d\u66f4\u65b0\u8f6f\u4ef6\u5305\u5217\u8868\uff0c\u4ee5\u83b7\u53d6\u6700\u65b0\u7684\u8f6f\u4ef6\u7248\u672c\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7<code>python3.8 --version<\/code>\u6765\u68c0\u67e5\u5b89\u88c5\u60c5\u51b5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5b89\u88c5Python 3.8.2\uff0c\u60a8\u9700\u8981\u786e\u5b9a\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u3001\u4e0b\u8f7d\u9002\u5408\u7684\u5b89\u88c5\u5305\u3001\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u3001\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u3002\u6211\u4eec\u5c06\u8be6 [&hellip;]","protected":false},"author":3,"featured_media":1001985,"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\/1001979"}],"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=1001979"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1001979\/revisions"}],"predecessor-version":[{"id":1001986,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1001979\/revisions\/1001986"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1001985"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1001979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1001979"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1001979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}