{"id":969870,"date":"2024-12-27T05:20:51","date_gmt":"2024-12-26T21:20:51","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/969870.html"},"modified":"2024-12-27T05:20:53","modified_gmt":"2024-12-26T21:20:53","slug":"%e5%a6%82%e4%bd%95%e6%9b%b4%e6%94%b9python%e9%bb%98%e8%ae%a4%e7%89%88%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/969870.html","title":{"rendered":"\u5982\u4f55\u66f4\u6539python\u9ed8\u8ba4\u7248\u672c"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24183937\/71a78088-cffe-46c8-ac51-401211162614.webp\" alt=\"\u5982\u4f55\u66f4\u6539python\u9ed8\u8ba4\u7248\u672c\" \/><\/p>\n<p><p> \u66f4\u6539Python\u9ed8\u8ba4\u7248\u672c\u53ef\u4ee5\u901a\u8fc7<strong>\u4fee\u6539\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u3001\u4f7f\u7528\u7248\u672c\u7ba1\u7406\u5de5\u5177\uff08\u5982pyenv\uff09<\/strong>\u548c<strong>\u66f4\u65b0\u7b26\u53f7\u94fe\u63a5<\/strong>\u6765\u5b9e\u73b0\u3002\u5176\u4e2d\uff0c\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528pyenv\uff0c\u56e0\u4e3a\u5b83\u63d0\u4f9b\u4e86\u7075\u6d3b\u7684\u7248\u672c\u7ba1\u7406\u548c\u5207\u6362\u529f\u80fd\u3002\u4ee5\u4e0b\u662f\u5173\u4e8e\u5982\u4f55\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\u66f4\u6539Python\u9ed8\u8ba4\u7248\u672c\u7684\u8be6\u7ec6\u6307\u5357\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4fee\u6539\u7cfb\u7edf\u73af\u5883\u53d8\u91cf<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4e86\u89e3\u5f53\u524dPython\u7248\u672c\u8def\u5f84<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u547d\u4ee4\u884c\u7ec8\u7aef\u8f93\u5165<code>which python<\/code>\u6216<code>where python<\/code>\uff08Windows\u4e0b\uff09\u67e5\u770b\u5f53\u524dPython\u8def\u5f84\u3002\u8bb0\u5f55\u4e0b\u8def\u5f84\u4fe1\u606f\uff0c\u4fbf\u4e8e\u540e\u7eed\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u65b0\u7684Python\u7248\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u524d\u5f80<a href=\"https:\/\/www.python.org\/\">Python\u5b98\u7f51<\/a>\u4e0b\u8f7d\u6240\u9700\u7684Python\u7248\u672c\uff0c\u5e76\u6309\u7167\u5e73\u53f0\u7684\u8981\u6c42\u8fdb\u884c\u5b89\u88c5\u3002\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u6ce8\u610f\u8bb0\u5f55\u5b89\u88c5\u8def\u5f84\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4fee\u6539\u73af\u5883\u53d8\u91cf<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>Windows<\/strong>\uff1a\u8fdb\u5165\u201c\u7cfb\u7edf\u5c5e\u6027\u201d-&gt;\u201c\u9ad8\u7ea7\u201d-&gt;\u201c\u73af\u5883\u53d8\u91cf\u201d\uff0c\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u4e2d\u627e\u5230\u5e76\u7f16\u8f91\u201cPath\u201d\u53d8\u91cf\u3002\u5c06\u65b0\u7684Python\u5b89\u88c5\u8def\u5f84\u79fb\u81f3\u5217\u8868\u7684\u524d\u9762\uff0c\u4ee5\u786e\u4fdd\u5b83\u4f18\u5148\u4e8e\u65e7\u7248\u672c\u8def\u5f84\u3002<\/li>\n<li><strong>macOS\/Linux<\/strong>\uff1a\u7f16\u8f91<code>~\/.bashrc<\/code>\u6216<code>~\/.bash_profile<\/code>\u6587\u4ef6\uff08\u53d6\u51b3\u4e8e\u4f7f\u7528\u7684shell\uff09\uff0c\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0<code>export PATH=&quot;\/path\/to\/new\/python:$PATH&quot;<\/code>\uff0c\u4fdd\u5b58\u540e\u6267\u884c<code>source ~\/.bashrc<\/code>\u6216<code>source ~\/.bash_profile<\/code>\u4ee5\u5e94\u7528\u66f4\u6539\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u66f4\u6539<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>python --version<\/code>\uff0c\u786e\u8ba4\u8f93\u51fa\u4e3a\u65b0\u5b89\u88c5\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u4f7f\u7528pyenv<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5pyenv<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>macOS\/Linux<\/strong>\uff1a\u53ef\u4ee5\u4f7f\u7528Homebrew\uff08macOS\uff09\u6216\u901a\u8fc7Git\u624b\u52a8\u5b89\u88c5\u3002\u5177\u4f53\u6b65\u9aa4\u8bf7\u53c2\u7167<a href=\"https:\/\/github.com\/pyenv\/pyenv#installation\">pyenv\u5b98\u65b9\u6587\u6863<\/a>\u3002<\/li>\n<li><strong>Windows<\/strong>\uff1a\u63a8\u8350\u4f7f\u7528<code>pyenv-win<\/code>\uff0c\u53ef\u4ee5\u5728PowerShell\u4e2d\u901a\u8fc7<code>pip install pyenv-win<\/code>\u8fdb\u884c\u5b89\u88c5\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Python\u7248\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528\u547d\u4ee4<code>pyenv install &lt;version&gt;<\/code>\u6765\u5b89\u88c5\u6240\u9700\u7684Python\u7248\u672c\u3002\u4f8b\u5982\uff0c<code>pyenv install 3.9.1<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8bbe\u7f6e\u5168\u5c40\u7248\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528\u547d\u4ee4<code>pyenv global &lt;version&gt;<\/code>\u6765\u8bbe\u7f6e\u5168\u5c40\u9ed8\u8ba4\u7248\u672c\u3002\u4f8b\u5982\uff0c<code>pyenv global 3.9.1<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u66f4\u6539<\/strong><\/p>\n<\/p>\n<p><p>\u8fd0\u884c<code>python --version<\/code>\u786e\u8ba4\u8f93\u51fa\u4e3a\u8bbe\u7f6e\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u66f4\u65b0\u7b26\u53f7\u94fe\u63a5<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u67e5\u627ePython\u6267\u884c\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u7cfb\u7edf\u4e2d\u67e5\u627ePython\u4e8c\u8fdb\u5236\u6587\u4ef6\u7684\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u901a\u8fc7<code>which python<\/code>\uff08macOS\/Linux\uff09\u6216<code>where python<\/code>\uff08Windows\uff09\u547d\u4ee4\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efa\u7b26\u53f7\u94fe\u63a5<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>macOS\/Linux<\/strong>\uff1a\u4f7f\u7528<code>ln -s \/path\/to\/new\/python \/usr\/local\/bin\/python<\/code>\u521b\u5efa\u7b26\u53f7\u94fe\u63a5\u3002<\/li>\n<li><strong>Windows<\/strong>\uff1a\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4<code>mklink \/d<\/code>\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u521b\u5efa\u7b26\u53f7\u94fe\u63a5\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u66f4\u6539<\/strong><\/p>\n<\/p>\n<p><p>\u901a\u8fc7<code>python --version<\/code>\u68c0\u67e5\u7b26\u53f7\u94fe\u63a5\u662f\u5426\u6307\u5411\u65b0\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u65b9\u6cd5\uff0c\u53ef\u4ee5\u7075\u6d3b\u5730\u66f4\u6539Python\u7684\u9ed8\u8ba4\u7248\u672c\u3002\u63a5\u4e0b\u6765\u5c06\u6df1\u5165\u63a2\u8ba8\u8fd9\u4e9b\u65b9\u6cd5\u7684\u7ec6\u8282\u548c\u6ce8\u610f\u4e8b\u9879\uff0c\u4ee5\u5e2e\u52a9\u8bfb\u8005\u66f4\u5168\u9762\u5730\u7406\u89e3\u548c\u5e94\u7528\u3002<\/p>\n<\/p>\n<hr>\n<p><p>\u4e00\u3001\u4fee\u6539\u7cfb\u7edf\u73af\u5883\u53d8\u91cf<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4e86\u89e3\u73af\u5883\u53d8\u91cf\u7684\u4f5c\u7528<\/strong><\/p>\n<\/p>\n<p><p>\u73af\u5883\u53d8\u91cf\u5728\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7528\u4e8e\u5b58\u50a8\u5173\u4e8e\u7cfb\u7edf\u73af\u5883\u7684\u4fe1\u606f\uff0cPython\u89e3\u91ca\u5668\u7684\u8def\u5f84\u901a\u5e38\u5b58\u50a8\u5728<code>PATH<\/code>\u73af\u5883\u53d8\u91cf\u4e2d\u3002\u901a\u8fc7\u8c03\u6574<code>PATH<\/code>\u53d8\u91cf\u4e2dPython\u8def\u5f84\u7684\u4f18\u5148\u7ea7\uff0c\u53ef\u4ee5\u6539\u53d8\u9ed8\u8ba4\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>Windows\u4e0a\u7684\u8be6\u7ec6\u6b65\u9aa4<\/strong><\/p>\n<\/p>\n<p><p>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u73af\u5883\u53d8\u91cf\u7684\u4fee\u6539\u53ef\u4ee5\u901a\u8fc7\u56fe\u5f62\u754c\u9762\u5b8c\u6210\u3002\u6253\u5f00\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\uff0c\u70b9\u51fb\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\uff0c\u7136\u540e\u70b9\u51fb\u201c\u73af\u5883\u53d8\u91cf\u201d\u3002\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u4e0b\uff0c\u627e\u5230\u201cPath\u201d\u53d8\u91cf\u5e76\u53cc\u51fb\u3002\u5728\u5f39\u51fa\u7684\u7a97\u53e3\u4e2d\uff0c\u53ef\u4ee5\u770b\u5230\u5404\u4e2a\u8def\u5f84\u7684\u5217\u8868\uff0c\u53ef\u4ee5\u901a\u8fc7\u62d6\u52a8\u6765\u8c03\u6574\u8def\u5f84\u7684\u4f18\u5148\u7ea7\uff0c\u5c06\u65b0Python\u7248\u672c\u7684\u8def\u5f84\u62d6\u5230\u6700\u524d\u9762\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>macOS\/Linux\u4e0a\u7684\u8be6\u7ec6\u6b65\u9aa4<\/strong><\/p>\n<\/p>\n<p><p>\u5728macOS\u548cLinux\u7cfb\u7edf\u4e2d\uff0c\u73af\u5883\u53d8\u91cf\u7684\u4fee\u6539\u901a\u5e38\u901a\u8fc7\u7f16\u8f91shell\u914d\u7f6e\u6587\u4ef6\u6765\u5b9e\u73b0\u3002\u5bf9\u4e8eBash shell\uff0c\u5e38\u7528\u7684\u662f<code>~\/.bashrc<\/code>\u6216<code>~\/.bash_profile<\/code>\u6587\u4ef6\u3002\u901a\u8fc7\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0<code>export PATH=&quot;\/path\/to\/new\/python:$PATH&quot;<\/code>\uff0c\u5e76\u4f7f\u7528<code>source<\/code>\u547d\u4ee4\u6765\u4f7f\u66f4\u6539\u751f\u6548\u3002\u4f7f\u7528<code>echo $PATH<\/code>\u53ef\u4ee5\u67e5\u770b\u5f53\u524d\u751f\u6548\u7684\u8def\u5f84\u53d8\u91cf\uff0c\u786e\u4fdd\u65b0\u8def\u5f84\u88ab\u6b63\u786e\u5e94\u7528\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u4f7f\u7528pyenv<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>pyenv\u7684\u4f18\u52bf<\/strong><\/p>\n<\/p>\n<p><p>pyenv\u662f\u4e00\u6b3e\u4e13\u95e8\u7ba1\u7406\u591a\u7248\u672cPython\u7684\u5de5\u5177\uff0c\u5141\u8bb8\u5728\u7cfb\u7edf\u4e2d\u5b89\u88c5\u591a\u4e2aPython\u7248\u672c\uff0c\u5e76\u80fd\u968f\u65f6\u5207\u6362\u3002pyenv\u6700\u5927\u7684\u4f18\u52bf\u5728\u4e8e\u5b83\u7684\u7075\u6d3b\u6027\uff0c\u7528\u6237\u53ef\u4ee5\u4e3a\u4e0d\u540c\u7684\u9879\u76ee\u8bbe\u7f6e\u4e0d\u540c\u7684Python\u7248\u672c\uff0c\u800c\u4e0d\u4f1a\u4e92\u76f8\u5f71\u54cd\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>pyenv\u7684\u5b89\u88c5\u548c\u4f7f\u7528<\/strong><\/p>\n<\/p>\n<p><p>\u5728macOS\u548cLinux\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7Homebrew\u6216Git\u514b\u9686\u5b89\u88c5pyenv\u3002\u5b89\u88c5\u6210\u529f\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528<code>pyenv install --list<\/code>\u67e5\u770b\u53ef\u7528\u7684Python\u7248\u672c\uff0c\u7136\u540e\u901a\u8fc7<code>pyenv install &lt;version&gt;<\/code>\u547d\u4ee4\u5b89\u88c5\u7279\u5b9a\u7248\u672c\u3002\u8bbe\u7f6e\u5168\u5c40\u9ed8\u8ba4\u7248\u672c\u53ef\u4ee5\u901a\u8fc7<code>pyenv global &lt;version&gt;<\/code>\u6765\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u914d\u7f6eshell<\/strong><\/p>\n<\/p>\n<p><p>\u4e3a\u4e86\u8ba9pyenv\u751f\u6548\uff0c\u9700\u8981\u5728shell\u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0\u521d\u59cb\u5316\u811a\u672c\u3002\u901a\u5e38\u662f\u5728<code>~\/.bashrc<\/code>\u6216<code>~\/.bash_profile<\/code>\u4e2d\u6dfb\u52a0<code>eval &quot;$(pyenv init --path)&quot;<\/code>\u548c<code>eval &quot;$(pyenv init -)&quot;<\/code>\u3002\u5b8c\u6210\u540e\uff0c\u91cd\u542f\u7ec8\u7aef\u6216\u6267\u884c<code>source ~\/.bashrc<\/code>\u6765\u5e94\u7528\u66f4\u6539\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u66f4\u65b0\u7b26\u53f7\u94fe\u63a5<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u7b26\u53f7\u94fe\u63a5\u7684\u6982\u5ff5<\/strong><\/p>\n<\/p>\n<p><p>\u7b26\u53f7\u94fe\u63a5\u7c7b\u4f3c\u4e8eWindows\u4e2d\u7684\u5feb\u6377\u65b9\u5f0f\uff0c\u6307\u5411\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u53e6\u4e00\u4e2a\u4f4d\u7f6e\u3002\u901a\u8fc7\u66f4\u65b0\u7b26\u53f7\u94fe\u63a5\uff0c\u53ef\u4ee5\u91cd\u5b9a\u5411\u7cfb\u7edf\u8c03\u7528\u5230\u65b0\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efa\u548c\u66f4\u65b0\u7b26\u53f7\u94fe\u63a5<\/strong><\/p>\n<\/p>\n<p><p>\u5728macOS\u548cLinux\u4e2d\uff0c\u4f7f\u7528<code>ln<\/code>\u547d\u4ee4\u53ef\u4ee5\u521b\u5efa\u7b26\u53f7\u94fe\u63a5\u3002\u9996\u5148\uff0c\u627e\u5230\u65b0Python\u7248\u672c\u7684\u5b89\u88c5\u8def\u5f84\uff0c\u7136\u540e\u5220\u9664\u65e7\u7684\u7b26\u53f7\u94fe\u63a5\uff0c\u5e76\u4f7f\u7528<code>ln -s<\/code>\u547d\u4ee4\u521b\u5efa\u65b0\u7684\u94fe\u63a5\u3002\u4f8b\u5982\uff0c<code>ln -s \/usr\/local\/bin\/python3.9 \/usr\/local\/bin\/python<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u7b26\u53f7\u94fe\u63a5<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528<code>ls -l \/usr\/local\/bin\/python<\/code>\u53ef\u4ee5\u67e5\u770b\u7b26\u53f7\u94fe\u63a5\u7684\u76ee\u6807\u8def\u5f84\uff0c\u786e\u4fdd\u6307\u5411\u6b63\u786e\u7684Python\u7248\u672c\u3002\u540c\u65f6\uff0c\u901a\u8fc7<code>python --version<\/code>\u9a8c\u8bc1\u9ed8\u8ba4\u7248\u672c\u662f\u5426\u5df2\u66f4\u6539\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u66f4\u6539Python\u7684\u9ed8\u8ba4\u7248\u672c\uff0c\u6839\u636e\u5b9e\u9645\u9700\u6c42\u9009\u62e9\u9002\u5408\u7684\u65b9\u6cd5\u3002\u65e0\u8bba\u662f\u901a\u8fc7\u73af\u5883\u53d8\u91cf\u3001pyenv\u8fd8\u662f\u7b26\u53f7\u94fe\u63a5\uff0c\u786e\u4fdd\u64cd\u4f5c\u540e\u8fdb\u884c\u9a8c\u8bc1\uff0c\u4ee5\u786e\u4fdd\u66f4\u6539\u5df2\u6210\u529f\u5e94\u7528\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u68c0\u67e5\u5f53\u524d\u7cfb\u7edf\u4e2d\u5b89\u88c5\u7684Python\u7248\u672c\uff1f<\/strong><br \/>\u60a8\u53ef\u4ee5\u901a\u8fc7\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165\u547d\u4ee4 <code>python --version<\/code> \u6216 <code>python3 --version<\/code> \u6765\u67e5\u770b\u5f53\u524d\u7684Python\u7248\u672c\u3002\u5982\u679c\u60a8\u5b89\u88c5\u4e86\u591a\u4e2a\u7248\u672c\u7684Python\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u5177\u4f53\u7684\u547d\u4ee4\u6765\u67e5\u770b\u3002<\/p>\n<p><strong>\u66f4\u6539Python\u9ed8\u8ba4\u7248\u672c\u662f\u5426\u4f1a\u5f71\u54cd\u73b0\u6709\u7684\u9879\u76ee\u548c\u73af\u5883\uff1f<\/strong><br \/>\u66f4\u6539\u9ed8\u8ba4\u7248\u672c\u53ef\u80fd\u4f1a\u5bf9\u73b0\u6709\u9879\u76ee\u4ea7\u751f\u5f71\u54cd\uff0c\u7279\u522b\u662f\u5982\u679c\u9879\u76ee\u4f9d\u8d56\u4e8e\u7279\u5b9a\u7684Python\u7248\u672c\u3002\u5982\u679c\u60a8\u6709\u591a\u4e2a\u9879\u76ee\uff0c\u5efa\u8bae\u4f7f\u7528\u865a\u62df\u73af\u5883\u6765\u9694\u79bb\u4e0d\u540c\u9879\u76ee\u7684\u4f9d\u8d56\u548cPython\u7248\u672c\uff0c\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u7248\u672c\u51b2\u7a81\u3002<\/p>\n<p><strong>\u5728Windows\u548cLinux\u7cfb\u7edf\u4e2d\u66f4\u6539Python\u9ed8\u8ba4\u7248\u672c\u7684\u65b9\u6cd5\u6709\u4f55\u4e0d\u540c\uff1f<\/strong><br \/>\u5728Windows\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u73af\u5883\u53d8\u91cf\u4e2d\u7684\u201cPath\u201d\u6765\u66f4\u6539\u9ed8\u8ba4\u7248\u672c\uff0c\u800c\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u901a\u5e38\u4f7f\u7528 <code>update-alternatives<\/code> \u547d\u4ee4\u6216\u901a\u8fc7\u521b\u5efa\u7b26\u53f7\u94fe\u63a5\u6765\u5b9e\u73b0\u3002\u5177\u4f53\u6b65\u9aa4\u53ef\u80fd\u4f1a\u6709\u6240\u4e0d\u540c\uff0c\u5efa\u8bae\u67e5\u9605\u76f8\u5173\u5e73\u53f0\u7684\u6587\u6863\u4ee5\u83b7\u53d6\u8be6\u7ec6\u6307\u5bfc\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u66f4\u6539Python\u9ed8\u8ba4\u7248\u672c\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u3001\u4f7f\u7528\u7248\u672c\u7ba1\u7406\u5de5\u5177\uff08\u5982pyenv\uff09\u548c\u66f4\u65b0\u7b26\u53f7\u94fe\u63a5\u6765\u5b9e\u73b0\u3002\u5176\u4e2d\uff0c [&hellip;]","protected":false},"author":3,"featured_media":969876,"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\/969870"}],"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=969870"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/969870\/revisions"}],"predecessor-version":[{"id":969878,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/969870\/revisions\/969878"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/969876"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=969870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=969870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=969870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}