{"id":1064820,"date":"2024-12-31T16:12:23","date_gmt":"2024-12-31T08:12:23","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1064820.html"},"modified":"2024-12-31T16:12:26","modified_gmt":"2024-12-31T08:12:26","slug":"mac%e8%87%aa%e5%b8%a6%e7%9a%84python%e5%a6%82%e4%bd%95%e8%bf%90%e8%a1%8c%e7%a8%8b%e5%ba%8f","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1064820.html","title":{"rendered":"mac\u81ea\u5e26\u7684python\u5982\u4f55\u8fd0\u884c\u7a0b\u5e8f"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/e6dcf80b-8629-4726-840f-f4f657746c0a.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"mac\u81ea\u5e26\u7684python\u5982\u4f55\u8fd0\u884c\u7a0b\u5e8f\" \/><\/p>\n<p><p> <strong>mac\u81ea\u5e26\u7684python\u5982\u4f55\u8fd0\u884c\u7a0b\u5e8f<\/strong><\/p>\n<\/p>\n<p><p>\u5728Mac\u4e0a\u8fd0\u884cPython\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u901a\u8fc7<strong>\u5728\u7ec8\u7aef\u4e2d\u4f7f\u7528\u547d\u4ee4\u884c<\/strong>\u3001<strong>\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/strong>\u3001<strong>\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668<\/strong>\u3001<strong>\u4f7f\u7528Jupyter Notebook<\/strong>\u7b49\u51e0\u79cd\u65b9\u5f0f\u6765\u5b9e\u73b0\u3002\u6bcf\u79cd\u65b9\u5f0f\u90fd\u6709\u5176\u72ec\u7279\u7684\u4f18\u70b9\uff0c\u8fd9\u91cc\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u5e76\u7740\u91cd\u4ecb\u7ecd\u5982\u4f55\u5728\u7ec8\u7aef\u4e2d\u4f7f\u7528\u547d\u4ee4\u884c\u8fd0\u884cPython\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u5728\u7ec8\u7aef\u4e2d\u4f7f\u7528\u547d\u4ee4\u884c<\/h3>\n<\/p>\n<p><h4>1\u3001\u68c0\u67e5Python\u7248\u672c<\/h4>\n<\/p>\n<p><p>\u5728Mac\u4e0a\u8fd0\u884cPython\u7a0b\u5e8f\u7684\u7b2c\u4e00\u6b65\u662f\u68c0\u67e5\u7cfb\u7edf\u4e2d\u662f\u5426\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u3002MacOS\u81ea\u5e26Python\uff0c\u901a\u5e38\u662fPython 2.x\u7248\u672c\uff0c\u4f46\u4e5f\u53ef\u4ee5\u624b\u52a8\u5b89\u88c5Python 3.x\u7248\u672c\u3002\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u68c0\u67e5\u5df2\u5b89\u88c5\u7684Python\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">python --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">python3 --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u7cfb\u7edf\u4e2d\u5df2\u5b89\u88c5Python\uff0c\u5c06\u4f1a\u663e\u793a\u5bf9\u5e94\u7684\u7248\u672c\u4fe1\u606f\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u7f16\u5199Python\u811a\u672c<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528\u4efb\u4f55\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982VSCode\u3001Sublime Text\u3001TextEdit\u7b49\uff09\u7f16\u5199Python\u811a\u672c\uff0c\u5e76\u4fdd\u5b58\u4e3a<code>.py<\/code>\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>hello.py<\/code>\u7684\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u786e\u4fdd\u4fdd\u5b58\u6587\u4ef6\u65f6\u9009\u62e9\u7eaf\u6587\u672c\u683c\u5f0f\uff0c\u5e76\u4fdd\u5b58\u4e3a<code>.py<\/code>\u6269\u5c55\u540d\u3002<\/p>\n<\/p>\n<p><h4>3\u3001\u8fd0\u884cPython\u811a\u672c<\/h4>\n<\/p>\n<p><p>\u5728\u7ec8\u7aef\u4e2d\u5bfc\u822a\u5230\u4fdd\u5b58Python\u811a\u672c\u7684\u76ee\u5f55\u3002\u4f8b\u5982\uff0c\u5982\u679c\u811a\u672c\u4fdd\u5b58\u5728\u684c\u9762\u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">cd ~\/Desktop<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u8fd0\u884cPython\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">python hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">python3 hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u4e00\u5207\u6b63\u5e38\uff0c\u7ec8\u7aef\u5c06\u4f1a\u663e\u793a<code>Hello, World!<\/code>\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/h3>\n<\/p>\n<p><h4>1\u3001\u9009\u62e9\u4e00\u4e2aIDE<\/h4>\n<\/p>\n<p><p>\u6709\u8bb8\u591a\u9002\u7528\u4e8eMac\u7684Python IDE\uff0c\u5982PyCharm\u3001Visual Studio Code\uff08VSCode\uff09\u3001Spyder\u7b49\u3002\u9009\u62e9\u4e00\u4e2a\u9002\u5408\u81ea\u5df1\u7684IDE\u6765\u7f16\u5199\u548c\u8fd0\u884cPython\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u5b89\u88c5\u548c\u914d\u7f6eIDE<\/h4>\n<\/p>\n<p><p>\u4ee5PyCharm\u4e3a\u4f8b\uff0c\u5b89\u88c5\u548c\u914d\u7f6e\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u4ecePyCharm\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5PyCharm\u3002<\/li>\n<li>\u6253\u5f00PyCharm\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\u3002<\/li>\n<li>\u5728\u9879\u76ee\u76ee\u5f55\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u6587\u4ef6\uff0c\u5e76\u7f16\u5199Python\u4ee3\u7801\u3002<\/li>\n<\/ol>\n<p><h4>3\u3001\u8fd0\u884cPython\u7a0b\u5e8f<\/h4>\n<\/p>\n<p><p>\u5728PyCharm\u4e2d\uff0c\u53ef\u4ee5\u76f4\u63a5\u70b9\u51fb\u8fd0\u884c\u6309\u94ae\u6765\u8fd0\u884cPython\u7a0b\u5e8f\u3002PyCharm\u4f1a\u81ea\u52a8\u5728\u7ec8\u7aef\u4e2d\u6267\u884c\u547d\u4ee4\uff0c\u5e76\u663e\u793a\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668<\/h3>\n<\/p>\n<p><h4>1\u3001\u9009\u62e9\u4e00\u4e2a\u6587\u672c\u7f16\u8f91\u5668<\/h4>\n<\/p>\n<p><p>\u5e38\u89c1\u7684\u6587\u672c\u7f16\u8f91\u5668\u6709VSCode\u3001Sublime Text\u3001Atom\u7b49\u3002\u9009\u62e9\u4e00\u4e2a\u9002\u5408\u81ea\u5df1\u7684\u6587\u672c\u7f16\u8f91\u5668\u6765\u7f16\u5199Python\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u7f16\u5199Python\u4ee3\u7801<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u7f16\u5199Python\u4ee3\u7801\uff0c\u5e76\u4fdd\u5b58\u4e3a<code>.py<\/code>\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>hello.py<\/code>\u7684\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u8fd0\u884cPython\u4ee3\u7801<\/h4>\n<\/p>\n<p><p>\u6253\u5f00\u7ec8\u7aef\uff0c\u5bfc\u822a\u5230\u4fdd\u5b58Python\u811a\u672c\u7684\u76ee\u5f55\uff0c\u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u8fd0\u884cPython\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">python hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">python3 hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7ec8\u7aef\u5c06\u4f1a\u663e\u793a<code>Hello, World!<\/code>\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528Jupyter Notebook<\/h3>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5Jupyter Notebook<\/h4>\n<\/p>\n<p><p>\u9996\u5148\u9700\u8981\u5b89\u88c5Jupyter Notebook\uff0c\u53ef\u4ee5\u4f7f\u7528pip\u6765\u5b89\u88c5\u3002\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pip install jupyter<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u5b89\u88c5pip\uff0c\u53ef\u4ee5\u53c2\u7167Python\u5b98\u65b9\u6587\u6863\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u542f\u52a8Jupyter Notebook<\/h4>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8Jupyter Notebook\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">jupyter notebook<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u4f1a\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00Jupyter Notebook\u754c\u9762\u3002<\/p>\n<\/p>\n<p><h4>3\u3001\u521b\u5efa\u548c\u8fd0\u884cPython\u4ee3\u7801<\/h4>\n<\/p>\n<p><p>\u5728Jupyter Notebook\u754c\u9762\u4e2d\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u7b14\u8bb0\u672c\uff0c\u5e76\u5728\u5355\u5143\u683c\u4e2d\u8f93\u5165Python\u4ee3\u7801\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\u8fd0\u884c\u5355\u5143\u683c\uff0c\u8f93\u51fa\u7ed3\u679c\u5c06\u4f1a\u663e\u793a\u5728\u5355\u5143\u683c\u4e0b\u65b9\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u8c03\u8bd5\u548c\u5e38\u89c1\u95ee\u9898<\/h3>\n<\/p>\n<p><h4>1\u3001\u8c03\u8bd5Python\u4ee3\u7801<\/h4>\n<\/p>\n<p><p>\u65e0\u8bba\u4f7f\u7528\u54ea\u79cd\u65b9\u5f0f\u8fd0\u884cPython\u7a0b\u5e8f\uff0c\u8c03\u8bd5\u90fd\u662f\u4e00\u4e2a\u91cd\u8981\u7684\u73af\u8282\u3002\u5e38\u89c1\u7684\u8c03\u8bd5\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528print\u8bed\u53e5\u3001\u4f7f\u7528Python\u5185\u7f6e\u7684\u8c03\u8bd5\u5668\uff08pdb\uff09\u3001\u4f7f\u7528IDE\u63d0\u4f9b\u7684\u8c03\u8bd5\u5de5\u5177\u7b49\u3002\u4ee5\u4f7f\u7528print\u8bed\u53e5\u4e3a\u4f8b\uff0c\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u63d2\u5165print\u8bed\u53e5\u6765\u68c0\u67e5\u53d8\u91cf\u7684\u503c\u548c\u7a0b\u5e8f\u7684\u6267\u884c\u6d41\u7a0b\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">x = 5<\/p>\n<p>print(&quot;Value of x:&quot;, x)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u89e3\u51b3\u5e38\u89c1\u95ee\u9898<\/h4>\n<\/p>\n<p><p>\u5728\u8fd0\u884cPython\u7a0b\u5e8f\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u9519\u8bef\u548c\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u53ca\u5176\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>\u6587\u4ef6\u672a\u627e\u5230\u9519\u8bef<\/strong>\uff1a\u786e\u4fdd\u5728\u7ec8\u7aef\u4e2d\u5bfc\u822a\u5230\u4fdd\u5b58Python\u811a\u672c\u7684\u76ee\u5f55\uff0c\u5e76\u68c0\u67e5\u6587\u4ef6\u540d\u662f\u5426\u6b63\u786e\u3002<\/li>\n<li><strong>\u8bed\u6cd5\u9519\u8bef<\/strong>\uff1a\u68c0\u67e5\u4ee3\u7801\u4e2d\u7684\u8bed\u6cd5\u9519\u8bef\uff0c\u786e\u4fdd\u4ee3\u7801\u7b26\u5408Python\u8bed\u6cd5\u89c4\u8303\u3002<\/li>\n<li><strong>\u6a21\u5757\u672a\u627e\u5230\u9519\u8bef<\/strong>\uff1a\u786e\u4fdd\u5df2\u5b89\u88c5\u6240\u9700\u7684Python\u6a21\u5757\uff0c\u53ef\u4ee5\u4f7f\u7528pip\u6765\u5b89\u88c5\u7f3a\u5931\u7684\u6a21\u5757\u3002<\/li>\n<\/ul>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728Mac\u4e0a\u8fd0\u884cPython\u7a0b\u5e8f\u6709\u591a\u79cd\u65b9\u5f0f\uff0c\u5305\u62ec\u5728\u7ec8\u7aef\u4e2d\u4f7f\u7528\u547d\u4ee4\u884c\u3001\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3001\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u3001\u4f7f\u7528Jupyter Notebook\u7b49\u3002\u6bcf\u79cd\u65b9\u5f0f\u90fd\u6709\u5176\u72ec\u7279\u7684\u4f18\u70b9\uff0c\u6839\u636e\u4e2a\u4eba\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u5f0f\u6765\u7f16\u5199\u548c\u8fd0\u884cPython\u7a0b\u5e8f\u3002\u65e0\u8bba\u4f7f\u7528\u54ea\u79cd\u65b9\u5f0f\uff0c\u638c\u63e1\u8c03\u8bd5\u6280\u5de7\u548c\u89e3\u51b3\u5e38\u89c1\u95ee\u9898\u7684\u65b9\u6cd5\u90fd\u662f\u63d0\u9ad8\u7f16\u7a0b\u6548\u7387\u7684\u91cd\u8981\u73af\u8282\u3002\u901a\u8fc7\u4e0d\u65ad\u5b9e\u8df5\u548c\u5b66\u4e60\uff0c\u53ef\u4ee5\u66f4\u597d\u5730\u638c\u63e1\u5728Mac\u4e0a\u8fd0\u884cPython\u7a0b\u5e8f\u7684\u6280\u5de7\u548c\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u68c0\u67e5\u6211\u7684Mac\u4e0a\u662f\u5426\u5df2\u5b89\u88c5Python\uff1f<\/strong><br \/>\u5728Mac\u4e0a\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u6253\u5f00\u201c\u7ec8\u7aef\u201d\u5e94\u7528\u7a0b\u5e8f\u5e76\u8f93\u5165\u547d\u4ee4<code>python --version<\/code>\u6216<code>python3 --version<\/code>\u6765\u68c0\u67e5Python\u7684\u5b89\u88c5\u60c5\u51b5\u3002\u8fd9\u5c06\u663e\u793a\u60a8\u5f53\u524d\u5b89\u88c5\u7684Python\u7248\u672c\u3002\u5982\u679c\u672a\u5b89\u88c5\uff0c\u60a8\u9700\u8981\u4e0b\u8f7d\u548c\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684Python\u3002<\/p>\n<p><strong>\u6211\u53ef\u4ee5\u4f7f\u7528\u54ea\u4e9b\u7f16\u8f91\u5668\u6765\u7f16\u5199Python\u7a0b\u5e8f\uff1f<\/strong><br \/>\u5728Mac\u4e0a\uff0c\u6709\u591a\u79cd\u7f16\u8f91\u5668\u53ef\u4f9b\u9009\u62e9\uff0c\u4f8b\u5982Visual Studio Code\u3001Sublime Text\u548cPyCharm\u7b49\u3002\u8fd9\u4e9b\u7f16\u8f91\u5668\u90fd\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\uff0c\u5982\u4ee3\u7801\u9ad8\u4eae\u3001\u81ea\u52a8\u5b8c\u6210\u548c\u8c03\u8bd5\u5de5\u5177\uff0c\u80fd\u591f\u5e2e\u52a9\u60a8\u66f4\u6709\u6548\u5730\u7f16\u5199Python\u4ee3\u7801\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c\u6211\u7684Python\u7a0b\u5e8f\uff1f<\/strong><br \/>\u5728\u7ec8\u7aef\u4e2d\uff0c\u60a8\u9700\u8981\u9996\u5148\u5bfc\u822a\u5230\u5305\u542bPython\u811a\u672c\u7684\u76ee\u5f55\u3002\u53ef\u4ee5\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u5207\u6362\u76ee\u5f55\u3002\u8f93\u5165<code>python your_script.py<\/code>\u6216<code>python3 your_script.py<\/code>\u6765\u8fd0\u884c\u7a0b\u5e8f\u3002\u786e\u4fdd\u5c06<code>your_script.py<\/code>\u66ff\u6362\u4e3a\u60a8\u7684\u5b9e\u9645\u6587\u4ef6\u540d\u3002<\/p>\n<p><strong>\u5982\u679c\u6211\u7684\u7a0b\u5e8f\u51fa\u73b0\u9519\u8bef\uff0c\u5982\u4f55\u8fdb\u884c\u8c03\u8bd5\uff1f<\/strong><br \/>\u8c03\u8bd5Python\u7a0b\u5e8f\u65f6\uff0c\u53ef\u4ee5\u67e5\u770b\u7ec8\u7aef\u4e2d\u663e\u793a\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u901a\u5e38\u4f1a\u6307\u660e\u51fa\u9519\u7684\u884c\u6570\u548c\u7c7b\u578b\u3002\u60a8\u4e5f\u53ef\u4ee5\u4f7f\u7528<code>print()<\/code>\u51fd\u6570\u5728\u4ee3\u7801\u4e2d\u63d2\u5165\u8c03\u8bd5\u4fe1\u606f\uff0c\u5e2e\u52a9\u60a8\u8ddf\u8e2a\u53d8\u91cf\u7684\u503c\u548c\u7a0b\u5e8f\u7684\u6267\u884c\u6d41\u3002\u6b64\u5916\uff0c\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u4e2d\u7684\u8c03\u8bd5\u5de5\u5177\u53ef\u4ee5\u66f4\u65b9\u4fbf\u5730\u9010\u6b65\u6267\u884c\u4ee3\u7801\uff0c\u68c0\u67e5\u53d8\u91cf\u72b6\u6001\u3002<\/p>\n<p><strong>\u6211\u662f\u5426\u53ef\u4ee5\u5728Mac\u4e0a\u4f7f\u7528\u865a\u62df\u73af\u5883\u6765\u7ba1\u7406Python\u9879\u76ee\uff1f<\/strong><br \/>\u662f\u7684\uff0c\u5728Mac\u4e0a\u4f7f\u7528\u865a\u62df\u73af\u5883\u662f\u4e00\u79cd\u5f88\u597d\u7684\u5b9e\u8df5\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528<code>venv<\/code>\u6a21\u5757\u521b\u5efa\u4e00\u4e2a\u72ec\u7acb\u7684\u73af\u5883\uff0c\u8fd9\u6837\u6bcf\u4e2a\u9879\u76ee\u90fd\u53ef\u4ee5\u62e5\u6709\u81ea\u5df1\u7684\u4f9d\u8d56\u5305\u3002\u53ea\u9700\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>python3 -m venv myenv<\/code>\u6765\u521b\u5efa\u4e00\u4e2a\u865a\u62df\u73af\u5883\uff0c\u5e76\u4f7f\u7528<code>source myenv\/bin\/activate<\/code>\u6fc0\u6d3b\u5b83\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"mac\u81ea\u5e26\u7684python\u5982\u4f55\u8fd0\u884c\u7a0b\u5e8f \u5728Mac\u4e0a\u8fd0\u884cPython\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728\u7ec8\u7aef\u4e2d\u4f7f\u7528\u547d\u4ee4\u884c\u3001\u4f7f\u7528\u96c6\u6210\u5f00\u53d1 [&hellip;]","protected":false},"author":3,"featured_media":1064825,"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\/1064820"}],"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=1064820"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1064820\/revisions"}],"predecessor-version":[{"id":1064826,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1064820\/revisions\/1064826"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1064825"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1064820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1064820"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1064820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}