{"id":979931,"date":"2024-12-27T06:50:30","date_gmt":"2024-12-26T22:50:30","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/979931.html"},"modified":"2024-12-27T06:50:33","modified_gmt":"2024-12-26T22:50:33","slug":"mac%e5%a6%82%e4%bd%95%e6%ad%a3%e7%a1%ae%e4%b8%8b%e8%bd%bdpython","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/979931.html","title":{"rendered":"mac\u5982\u4f55\u6b63\u786e\u4e0b\u8f7dpython"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24205534\/b943931d-d74a-46c7-b505-370774e22024.webp\" alt=\"mac\u5982\u4f55\u6b63\u786e\u4e0b\u8f7dpython\" \/><\/p>\n<p><p> <strong>\u8981\u5728Mac\u4e0a\u6b63\u786e\u4e0b\u8f7dPython\uff0c\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u5b98\u65b9Python\u7f51\u7ad9\u4e0b\u8f7d\u3001\u4f7f\u7528Homebrew\u5b89\u88c5\u3001\u901a\u8fc7Anaconda\u8fdb\u884c\u7ba1\u7406\u7b49\u591a\u79cd\u65b9\u6cd5\uff0c\u786e\u4fddPython\u7684\u7248\u672c\u66f4\u65b0\u5e76\u4fdd\u6301\u7cfb\u7edf\u7684\u7a33\u5b9a\u6027\u3002<\/strong>\u4e0b\u8f7dPython\u65f6\uff0c\u9009\u62e9\u9002\u5408\u81ea\u5df1\u9700\u6c42\u7684\u7248\u672c\u548c\u5b89\u88c5\u65b9\u5f0f\u975e\u5e38\u91cd\u8981\u3002\u5bf9\u4e8e\u65b0\u624b\u7528\u6237\uff0c\u4f7f\u7528Python\u7684\u5b98\u65b9\u7f51\u7ad9\u63d0\u4f9b\u7684\u5b89\u88c5\u5305\u662f\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u3002\u5bf9\u4e8e\u9700\u8981\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c\u7684\u7528\u6237\uff0cAnaconda\u662f\u4e00\u4e2a\u7406\u60f3\u7684\u9009\u62e9\uff0c\u56e0\u4e3a\u5b83\u4e0d\u4ec5\u7ba1\u7406Python\u7248\u672c\uff0c\u8fd8\u53ef\u4ee5\u7ba1\u7406Python\u7684\u5305\u548c\u73af\u5883\u3002Homebrew\u5219\u662fmacOS\u4e0a\u7684\u4e00\u4e2a\u5f3a\u5927\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u5b89\u88c5\u548c\u5347\u7ea7Python\u53ca\u5176\u76f8\u5173\u5de5\u5177\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528Python\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d<\/p>\n<\/p>\n<p><p>Python\u5b98\u65b9\u7f51\u7ad9\u662f\u83b7\u53d6Python\u7684\u6700\u76f4\u63a5\u6765\u6e90\u3002\u7f51\u7ad9\u4f1a\u63d0\u4f9b\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u672c\uff0c\u5e76\u4e14\u6709\u8be6\u7ec6\u7684\u5b89\u88c5\u8bf4\u660e\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8bbf\u95eePython\u5b98\u7f51<\/strong><br \/>\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.python.org%EF%BC%89%E3%80%82%E5%9C%A8%E9%A6%96%E9%A1%B5%EF%BC%8C%E4%BD%A0%E4%BC%9A%E7%9C%8B%E5%88%B0%E6%9C%80%E6%96%B0%E7%9A%84Python%E7%89%88%E6%9C%AC%E3%80%82%E7%82%B9%E5%87%BB%E4%B8%8B%E8%BD%BD%E9%A1%B5%E9%9D%A2%E4%BB%A5%E6%9F%A5%E7%9C%8B%E5%8F%AF%E7%94%A8%E7%9A%84%E7%89%88%E6%9C%AC%E5%92%8C%E5%AE%89%E8%A3%85%E9%80%89%E9%A1%B9%E3%80%82\">https:\/\/www.python.org\uff09\u3002\u5728\u9996\u9875\uff0c\u4f60\u4f1a\u770b\u5230\u6700\u65b0\u7684Python\u7248\u672c\u3002\u70b9\u51fb\u4e0b\u8f7d\u9875\u9762\u4ee5\u67e5\u770b\u53ef\u7528\u7684\u7248\u672c\u548c\u5b89\u88c5\u9009\u9879\u3002<\/a><\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9009\u62e9\u5408\u9002\u7684\u7248\u672c<\/strong><br \/>\u901a\u5e38\uff0c\u7f51\u7ad9\u4f1a\u81ea\u52a8\u68c0\u6d4b\u4f60\u7684\u64cd\u4f5c\u7cfb\u7edf\u5e76\u63d0\u4f9b\u9002\u5408\u7684\u7248\u672c\u4e0b\u8f7d\u94fe\u63a5\u3002\u9009\u62e9\u9002\u5408\u4f60\u9700\u6c42\u7684\u7248\u672c\uff0c\u901a\u5e38\u5efa\u8bae\u4e0b\u8f7d\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4e0b\u8f7d\u548c\u5b89\u88c5<\/strong><br \/>\u70b9\u51fb\u4e0b\u8f7d\u6309\u94ae\u540e\uff0c\u7cfb\u7edf\u4f1a\u4e0b\u8f7d\u4e00\u4e2a.dmg\u6587\u4ef6\u3002\u53cc\u51fb\u6253\u5f00\u8be5\u6587\u4ef6\u540e\uff0c\u6309\u7167\u63d0\u793a\u8fdb\u884c\u5b89\u88c5\u3002\u5b89\u88c5\u7a0b\u5e8f\u4f1a\u5f15\u5bfc\u4f60\u5b8c\u6210\u5b89\u88c5\u6b65\u9aa4\uff0c\u901a\u5e38\u53ea\u9700\u8981\u70b9\u51fb\u201c\u7ee7\u7eed\u201d\u548c\u201c\u5b89\u88c5\u201d\u5373\u53ef\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong><br \/>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00\u7ec8\u7aef\u5e76\u8f93\u5165<code>python3 --version<\/code>\u6765\u68c0\u67e5\u662f\u5426\u5b89\u88c5\u6210\u529f\uff0c\u5e76\u67e5\u770b\u5b89\u88c5\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u4f7f\u7528Homebrew\u5b89\u88c5Python<\/p>\n<\/p>\n<p><p>Homebrew\u662fmacOS\u4e0a\u7684\u4e00\u4e2a\u6d41\u884c\u7684\u5305\u7ba1\u7406\u5668\uff0c\u4f7f\u7528\u5b83\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u5b89\u88c5\u548c\u7ba1\u7406Python\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5Homebrew<\/strong><br \/>\u5982\u679c\u4f60\u8fd8\u6ca1\u6709\u5b89\u88c5Homebrew\uff0c\u53ef\u4ee5\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">\/bin\/bash -c &quot;$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/HEAD\/install.sh)&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5b89\u88c5\u8fc7\u7a0b\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Python<\/strong><br \/>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u901a\u8fc7Homebrew\u5b89\u88c5Python\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">brew install python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u5b89\u88c5\u6700\u65b0\u7684Python\u7248\u672c\uff0c\u5e76\u81ea\u52a8\u8bbe\u7f6e\u597d\u73af\u5883\u53d8\u91cf\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong><br \/>\u540c\u6837\u5730\uff0c\u901a\u8fc7\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>python3 --version<\/code>\u6765\u9a8c\u8bc1Python\u662f\u5426\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u901a\u8fc7Anaconda\u7ba1\u7406Python<\/p>\n<\/p>\n<p><p>Anaconda\u662f\u4e00\u4e2a\u5f3a\u5927\u7684Python\u53d1\u884c\u7248\uff0c\u9002\u5408\u90a3\u4e9b\u9700\u8981\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c\u548c\u79d1\u5b66\u8ba1\u7b97\u5305\u7684\u7528\u6237\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4e0b\u8f7dAnaconda<\/strong><br \/>\u8bbf\u95eeAnaconda\u7684\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.anaconda.com%EF%BC%89%EF%BC%8C%E9%80%89%E6%8B%A9%E2%80%9CDownload%E2%80%9D%E9%80%89%E9%A1%B9%EF%BC%8C%E7%84%B6%E5%90%8E%E9%80%89%E6%8B%A9%E9%80%82%E5%90%88macOS%E7%9A%84%E7%89%88%E6%9C%AC%E8%BF%9B%E8%A1%8C%E4%B8%8B%E8%BD%BD%E3%80%82\">https:\/\/www.anaconda.com\uff09\uff0c\u9009\u62e9\u201cDownload\u201d\u9009\u9879\uff0c\u7136\u540e\u9009\u62e9\u9002\u5408macOS\u7684\u7248\u672c\u8fdb\u884c\u4e0b\u8f7d\u3002<\/a><\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Anaconda<\/strong><br \/>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u53cc\u51fb\u5b89\u88c5\u5305\u5e76\u6309\u7167\u63d0\u793a\u8fdb\u884c\u5b89\u88c5\u3002Anaconda\u4f1a\u81ea\u52a8\u914d\u7f6ePython\u73af\u5883\uff0c\u5e76\u63d0\u4f9b\u4e00\u4e2a\u5f3a\u5927\u7684\u5305\u7ba1\u7406\u5668conda\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8bbe\u7f6e\u548c\u7ba1\u7406\u73af\u5883<\/strong><br \/>\u4f7f\u7528conda\u547d\u4ee4\u53ef\u4ee5\u65b9\u4fbf\u5730\u521b\u5efa\u548c\u7ba1\u7406\u591a\u4e2aPython\u73af\u5883\u3002\u4f8b\u5982\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python 3.8\u73af\u5883\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>\u6fc0\u6d3b\u73af\u5883\u53ef\u4ee5\u4f7f\u7528\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda activate myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/p>\n<\/p>\n<p><p>\u5728\u5b89\u88c5Python\u4e4b\u540e\uff0c\u53ef\u80fd\u9700\u8981\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u4ee5\u786e\u4fdd\u7ec8\u7aef\u80fd\u591f\u6b63\u786e\u8bc6\u522bPython\u547d\u4ee4\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u914d\u7f6e\u8def\u5f84<\/strong><br \/>\u6253\u5f00\u7ec8\u7aef\uff0c\u7f16\u8f91\u4f60\u7684shell\u914d\u7f6e\u6587\u4ef6\uff08\u4f8b\u5982.bash_profile, .zshrc\u7b49\uff09\uff0c\u5c06Python\u7684\u8def\u5f84\u6dfb\u52a0\u5230PATH\u4e2d\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">export PATH=&quot;\/usr\/local\/opt\/python\/libexec\/bin:$PATH&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4fdd\u5b58\u6587\u4ef6\u5e76\u6267\u884c<code>source ~\/.bash_profile<\/code>\u6216<code>source ~\/.zshrc<\/code>\u6765\u66f4\u65b0\u7ec8\u7aef\u914d\u7f6e\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u914d\u7f6e<\/strong><br \/>\u91cd\u65b0\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165<code>which python3<\/code>\uff0c\u786e\u4fdd\u8f93\u51fa\u7684\u8def\u5f84\u662f\u4f60\u671f\u671b\u7684Python\u7248\u672c\u8def\u5f84\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u5b89\u88c5Python\u5305\u7ba1\u7406\u5de5\u5177<\/p>\n<\/p>\n<p><p>\u65e0\u8bba\u4f60\u4f7f\u7528\u54ea\u79cd\u65b9\u5f0f\u5b89\u88c5Python\uff0c\u4f7f\u7528pip\u6765\u7ba1\u7406Python\u5305\u90fd\u662f\u975e\u5e38\u65b9\u4fbf\u7684\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528pip\u5b89\u88c5\u5305<\/strong><br \/>\u5728\u7ec8\u7aef\u4e2d\uff0c\u4f7f\u7528pip\u547d\u4ee4\u6765\u5b89\u88c5\u4f60\u9700\u8981\u7684Python\u5305\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install numpy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u5b89\u88c5numpy\u5e93\uff0c\u4fbf\u4e8e\u8fdb\u884c\u79d1\u5b66\u8ba1\u7b97\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5347\u7ea7pip<\/strong><br \/>\u5b9a\u671f\u5347\u7ea7pip\u4ee5\u786e\u4fdd\u62e5\u6709\u6700\u65b0\u7684\u529f\u80fd\u548c\u5b89\u5168\u8865\u4e01\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 -m pip install --upgrade pip<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u516d\u3001\u5e38\u89c1\u95ee\u9898\u548c\u89e3\u51b3\u65b9\u6848<\/p>\n<\/p>\n<p><p>\u5728\u5b89\u88c5Python\u7684\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\uff0c\u8fd9\u91cc\u63d0\u4f9b\u4e00\u4e9b\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Python\u7248\u672c\u51b2\u7a81<\/strong><br \/>\u5982\u679c\u4f60\u5df2\u7ecf\u6709\u591a\u4e2aPython\u7248\u672c\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u7248\u672c\u51b2\u7a81\u7684\u95ee\u9898\u3002\u4f7f\u7528pyenv\u6216Anaconda\u6765\u7ba1\u7406\u4e0d\u540c\u7248\u672c\u662f\u4e00\u4e2a\u5f88\u597d\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6743\u9650\u95ee\u9898<\/strong><br \/>\u5728\u5b89\u88c5\u6216\u66f4\u65b0Python\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u6743\u9650\u4e0d\u8db3\u7684\u95ee\u9898\u3002\u5c1d\u8bd5\u4f7f\u7528sudo\u547d\u4ee4\u6765\u63d0\u5347\u6743\u9650\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo pip install somepackage<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8def\u5f84\u95ee\u9898<\/strong><br \/>\u5982\u679c\u7ec8\u7aef\u627e\u4e0d\u5230Python\u547d\u4ee4\uff0c\u68c0\u67e5\u4f60\u7684\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u662f\u5426\u6b63\u786e\u3002\u786e\u4fddPATH\u4e2d\u5305\u542bPython\u7684\u5b89\u88c5\u8def\u5f84\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u5728Mac\u4e0a\u6b63\u786e\u5730\u4e0b\u8f7d\u548c\u5b89\u88c5Python\uff0c\u5e76\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5b89\u88c5\u65b9\u5f0f\u3002\u65e0\u8bba\u4f60\u662fPython\u65b0\u624b\u8fd8\u662f\u7ecf\u9a8c\u4e30\u5bcc\u7684\u5f00\u53d1\u8005\uff0c\u9009\u62e9\u5408\u9002\u7684\u5de5\u5177\u548c\u65b9\u6cd5\u90fd\u80fd\u63d0\u9ad8\u4f60\u7684\u5de5\u4f5c\u6548\u7387\u548c\u5f00\u53d1\u4f53\u9a8c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5728Mac\u4e0a\u4e0b\u8f7dPython\u65f6\uff0c\u6211\u5e94\u8be5\u9009\u62e9\u54ea\u4e2a\u7248\u672c\uff1f<\/strong><br \/>\u9009\u62e9Python\u7684\u7248\u672c\u65f6\uff0c\u5efa\u8bae\u4f7f\u7528\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u672c\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0cPython 3.x\u7cfb\u5217\u662f\u66f4\u53d7\u6b22\u8fce\u7684\u9009\u62e9\uff0c\u56e0\u4e3a\u5b83\u5305\u542b\u4e86\u8bb8\u591a\u65b0\u7279\u6027\u548c\u4f18\u5316\uff0c\u4e14\u5927\u591a\u6570\u73b0\u4ee3\u5e93\u548c\u6846\u67b6\u90fd\u5df2\u652f\u6301\u8be5\u7248\u672c\u3002\u5982\u679c\u4f60\u7684\u9879\u76ee\u6216\u5e94\u7528\u7a0b\u5e8f\u9700\u8981\u7279\u5b9a\u7248\u672c\u7684Python\uff0c\u53ef\u4ee5\u5728Python\u7684\u5b98\u65b9\u7f51\u7ad9\u4e0a\u627e\u5230\u5386\u53f2\u7248\u672c\u7684\u4e0b\u8f7d\u94fe\u63a5\u3002<\/p>\n<p><strong>\u4e0b\u8f7dPython\u540e\uff0c\u5982\u4f55\u786e\u8ba4\u5b89\u88c5\u662f\u5426\u6210\u529f\uff1f<\/strong><br \/>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u6253\u5f00\u7ec8\u7aef\u5e76\u8f93\u5165<code>python3 --version<\/code>\u6216<code>python --version<\/code>\u6765\u68c0\u67e5Python\u7684\u5b89\u88c5\u60c5\u51b5\u3002\u5982\u679c\u7ec8\u7aef\u8fd4\u56de\u4e86Python\u7684\u7248\u672c\u53f7\uff0c\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002\u5982\u679c\u672a\u627e\u5230\u547d\u4ee4\uff0c\u53ef\u80fd\u9700\u8981\u5c06Python\u7684\u8def\u5f84\u6dfb\u52a0\u5230\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\u4e2d\u3002<\/p>\n<p><strong>\u5728Mac\u4e0a\u5b89\u88c5Python\u65f6\uff0c\u4f7f\u7528Homebrew\u6709\u4ec0\u4e48\u4f18\u52bf\uff1f<\/strong><br \/>\u4f7f\u7528Homebrew\u5b89\u88c5Python\u53ef\u4ee5\u7b80\u5316\u7ba1\u7406\u548c\u66f4\u65b0\u8fc7\u7a0b\u3002Homebrew\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u5141\u8bb8\u7528\u6237\u65b9\u4fbf\u5730\u5b89\u88c5\u548c\u66f4\u65b0\u8f6f\u4ef6\u3002\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>brew install python<\/code>\u5c31\u53ef\u4ee5\u5feb\u901f\u5b89\u88c5Python\uff0c\u5e76\u4e14\u53ef\u4ee5\u901a\u8fc7<code>brew update<\/code>\u548c<code>brew upgrade<\/code>\u8f7b\u677e\u7ba1\u7406\u7248\u672c\u3002\u6b64\u5916\uff0cHomebrew\u8fd8\u53ef\u4ee5\u5904\u7406\u4f9d\u8d56\u5173\u7cfb\uff0c\u4f7f\u5f97\u5b89\u88c5\u5176\u4ed6\u76f8\u5173\u5de5\u5177\u548c\u5e93\u53d8\u5f97\u66f4\u52a0\u5bb9\u6613\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728Mac\u4e0a\u6b63\u786e\u4e0b\u8f7dPython\uff0c\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u5b98\u65b9Python\u7f51\u7ad9\u4e0b\u8f7d\u3001\u4f7f\u7528Homebrew\u5b89\u88c5\u3001\u901a\u8fc7Anac [&hellip;]","protected":false},"author":3,"featured_media":979941,"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\/979931"}],"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=979931"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/979931\/revisions"}],"predecessor-version":[{"id":979942,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/979931\/revisions\/979942"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/979941"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=979931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=979931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=979931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}