{"id":956633,"date":"2024-12-27T02:39:08","date_gmt":"2024-12-26T18:39:08","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/956633.html"},"modified":"2024-12-27T02:39:11","modified_gmt":"2024-12-26T18:39:11","slug":"%e5%a6%82%e4%bd%95%e6%9f%a5%e7%9c%8bpython%e5%ae%89%e8%a3%85%e4%bd%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/956633.html","title":{"rendered":"\u5982\u4f55\u67e5\u770bpython\u5b89\u88c5\u4f4d\u7f6e"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25100217\/77157414-7f1d-4a9d-b0de-d40019d768c3.webp\" alt=\"\u5982\u4f55\u67e5\u770bpython\u5b89\u88c5\u4f4d\u7f6e\" \/><\/p>\n<p><p> <strong>\u8981\u67e5\u770bPython\u7684\u5b89\u88c5\u4f4d\u7f6e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\uff1a\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u3001\u901a\u8fc7Python\u811a\u672c\u67e5\u627e\u3001\u4f7f\u7528Python\u73af\u5883\u7ba1\u7406\u5de5\u5177\u3002\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u901a\u8fc7\u547d\u4ee4\u884c\u5de5\u5177\u67e5\u627ePython\u7684\u5b89\u88c5\u8def\u5f84\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u5728Windows\u4e0a\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u63d0\u793a\u7b26\u6216PowerShell\u6765\u67e5\u627ePython\u7684\u5b89\u88c5\u4f4d\u7f6e\u3002\u9996\u5148\uff0c\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u6216PowerShell\uff0c\u7136\u540e\u8f93\u5165<code>where python<\/code>\u547d\u4ee4\u3002\u8fd9\u5c06\u663e\u793aPython\u53ef\u6267\u884c\u6587\u4ef6\u7684\u8def\u5f84\u3002\u901a\u5e38\uff0c\u7ed3\u679c\u4f1a\u663e\u793aPython\u89e3\u91ca\u5668\u7684\u5b89\u88c5\u8def\u5f84\uff0c\u4f8b\u5982<code>C:\\Python39\\python.exe<\/code>\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u6cd5\uff0c\u4f60\u53ef\u4ee5\u5feb\u901f\u4e86\u89e3Python\u7684\u5b89\u88c5\u4f4d\u7f6e\u3002<\/p>\n<\/p>\n<p><p>\u5728macOS\u548cLinux\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528\u7ec8\u7aef\u6765\u67e5\u627ePython\u7684\u5b89\u88c5\u8def\u5f84\u3002\u6253\u5f00\u7ec8\u7aef\u5e76\u8f93\u5165<code>which python<\/code>\u547d\u4ee4\u3002\u8fd9\u5c06\u8fd4\u56dePython\u53ef\u6267\u884c\u6587\u4ef6\u7684\u8def\u5f84\uff0c\u4f8b\u5982<code>\/usr\/local\/bin\/python<\/code>\u6216<code>\/usr\/bin\/python<\/code>\u3002\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662fPython 3.x\u7248\u672c\uff0c\u53ef\u80fd\u9700\u8981\u8f93\u5165<code>which python3<\/code>\u6765\u83b7\u53d6\u6b63\u786e\u7684\u8def\u5f84\u3002<\/p>\n<\/p>\n<hr>\n<p><p>\u4e00\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177<\/p>\n<\/p>\n<p><p>\u5728\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u5de5\u5177\u6765\u67e5\u627ePython\u7684\u5b89\u88c5\u4f4d\u7f6e\u3002\u8fd9\u662f\u6700\u7b80\u5355\u548c\u76f4\u63a5\u7684\u65b9\u6cd5\uff0c\u4e0d\u9700\u8981\u7f16\u5199\u4efb\u4f55\u4ee3\u7801\u6216\u5b89\u88c5\u989d\u5916\u7684\u8f6f\u4ef6\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>Windows\u7cfb\u7edf<\/strong><\/li>\n<\/ol>\n<p><p>\u5728Windows\u7cfb\u7edf\u4e0a\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u63d0\u793a\u7b26\uff08Command Prompt\uff09\u6216PowerShell\u6765\u67e5\u627ePython\u7684\u5b89\u88c5\u4f4d\u7f6e\u3002\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u6216PowerShell\u3002<\/li>\n<li>\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5e76\u6309\u56de\u8f66\u952e\uff1a\n<pre><code>where python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u6b64\u547d\u4ee4\u5c06\u663e\u793aPython\u53ef\u6267\u884c\u6587\u4ef6\u7684\u8def\u5f84\u3002\u4f8b\u5982\uff0c\u5982\u679cPython\u5b89\u88c5\u5728\u9ed8\u8ba4\u8def\u5f84\u4e0b\uff0c\u7ed3\u679c\u53ef\u80fd\u662f<code>C:\\Python39\\python.exe<\/code>\u3002\u5982\u679c\u6709\u591a\u4e2aPython\u7248\u672c\u5b89\u88c5\u5728\u7cfb\u7edf\u4e2d\uff0c\u8be5\u547d\u4ee4\u5c06\u5217\u51fa\u6240\u6709\u7248\u672c\u7684\u8def\u5f84\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>macOS\u548cLinux\u7cfb\u7edf<\/strong><\/li>\n<\/ol>\n<p><p>\u5728macOS\u548cLinux\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528\u7ec8\u7aef\uff08Terminal\uff09\u6765\u67e5\u627ePython\u7684\u5b89\u88c5\u8def\u5f84\u3002\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u7ec8\u7aef\u3002<\/li>\n<li>\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5e76\u6309\u56de\u8f66\u952e\uff1a\n<pre><code>which python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u6b64\u547d\u4ee4\u5c06\u8fd4\u56dePython\u53ef\u6267\u884c\u6587\u4ef6\u7684\u8def\u5f84\uff0c\u4f8b\u5982<code>\/usr\/local\/bin\/python<\/code>\u6216<code>\/usr\/bin\/python<\/code>\u3002\u5982\u679c\u4f60\u7684\u7cfb\u7edf\u4e2d\u5b89\u88c5\u4e86Python 3.x\u7248\u672c\uff0c\u53ef\u80fd\u9700\u8981\u8f93\u5165<code>which python3<\/code>\u6765\u83b7\u53d6\u6b63\u786e\u7684\u8def\u5f84\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u901a\u8fc7Python\u811a\u672c\u67e5\u627e<\/p>\n<\/p>\n<p><p>\u9664\u4e86\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7\u7f16\u5199\u4e00\u4e2a\u7b80\u5355\u7684Python\u811a\u672c\u6765\u67e5\u627ePython\u7684\u5b89\u88c5\u4f4d\u7f6e\u3002\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u6240\u6709\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5e76\u4e14\u53ef\u4ee5\u7528\u6765\u68c0\u67e5Python\u7684\u591a\u79cd\u73af\u5883\u8bbe\u7f6e\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u7f16\u5199Python\u811a\u672c<\/strong><\/li>\n<\/ol>\n<p><p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8bPython\u811a\u672c\uff0c\u7528\u4e8e\u67e5\u627ePython\u7684\u5b89\u88c5\u4f4d\u7f6e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import sys<\/p>\n<p>print(sys.executable)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e2a\u811a\u672c\u4f7f\u7528\u4e86Python\u7684<code>sys<\/code>\u6a21\u5757\u4e2d\u7684<code>executable<\/code>\u5c5e\u6027\uff0c\u8be5\u5c5e\u6027\u8fd4\u56dePython\u89e3\u91ca\u5668\u7684\u8def\u5f84\u3002\u8fd0\u884c\u8fd9\u4e2a\u811a\u672c\u5c06\u8f93\u51faPython\u7684\u5b89\u88c5\u8def\u5f84\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u8fd0\u884cPython\u811a\u672c<\/strong><\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u5728Windows\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u63d0\u793a\u7b26\u6216PowerShell\u8fd0\u884c\u8be5\u811a\u672c\u3002\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u6216PowerShell\uff0c\u5bfc\u822a\u5230\u811a\u672c\u6240\u5728\u7684\u76ee\u5f55\uff0c\u7136\u540e\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code>python script_name.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5176\u4e2d<code>script_name.py<\/code>\u662f\u4f60\u7684\u811a\u672c\u6587\u4ef6\u540d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u5728macOS\u548cLinux\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7\u7ec8\u7aef\u8fd0\u884c\u8be5\u811a\u672c\u3002\u6253\u5f00\u7ec8\u7aef\uff0c\u5bfc\u822a\u5230\u811a\u672c\u6240\u5728\u7684\u76ee\u5f55\uff0c\u7136\u540e\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code>python3 script_name.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u4e09\u3001\u4f7f\u7528Python\u73af\u5883\u7ba1\u7406\u5de5\u5177<\/p>\n<\/p>\n<p><p>Python\u73af\u5883\u7ba1\u7406\u5de5\u5177\uff0c\u4f8b\u5982<code>pyenv<\/code>\u3001<code>conda<\/code>\u7b49\uff0c\u4e5f\u53ef\u4ee5\u5e2e\u52a9\u4f60\u67e5\u627ePython\u7684\u5b89\u88c5\u4f4d\u7f6e\u3002\u8fd9\u4e9b\u5de5\u5177\u4e0d\u4ec5\u7528\u4e8e\u7ba1\u7406Python\u7248\u672c\uff0c\u8fd8\u53ef\u4ee5\u63d0\u4f9b\u6709\u5173\u5b89\u88c5\u8def\u5f84\u7684\u4fe1\u606f\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u4f7f\u7528pyenv<\/strong><\/li>\n<\/ol>\n<p><p><code>pyenv<\/code>\u662f\u4e00\u4e2a\u7528\u4e8e\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c\u7684\u5de5\u5177\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528<code>pyenv<\/code>\u6765\u67e5\u770b\u5f53\u524d\u4f7f\u7528\u7684Python\u7248\u672c\u53ca\u5176\u5b89\u88c5\u8def\u5f84\u3002\u9996\u5148\uff0c\u786e\u4fdd<code>pyenv<\/code>\u5df2\u5b89\u88c5\u5e76\u914d\u7f6e\u6b63\u786e\u3002\u7136\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5b89\u88c5\u8def\u5f84\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pyenv which python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8be5\u547d\u4ee4\u5c06\u8fd4\u56de\u5f53\u524d\u6fc0\u6d3b\u7684Python\u7248\u672c\u7684\u53ef\u6267\u884c\u6587\u4ef6\u8def\u5f84\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u4f7f\u7528conda<\/strong><\/li>\n<\/ol>\n<p><p>\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662fAnaconda\u6216Miniconda\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7<code>conda<\/code>\u547d\u4ee4\u67e5\u770bPython\u7684\u5b89\u88c5\u8def\u5f84\u3002\u9996\u5148\uff0c\u6fc0\u6d3b\u4f60\u6b63\u5728\u4f7f\u7528\u7684conda\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda activate your_environment_name<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5b89\u88c5\u8def\u5f84\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">which python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728Windows\u4e0a\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u4f7f\u7528<code>where python<\/code>\u547d\u4ee4\u3002\u8fd9\u4e2a\u547d\u4ee4\u5c06\u8fd4\u56de\u5f53\u524dconda\u73af\u5883\u4e2dPython\u53ef\u6267\u884c\u6587\u4ef6\u7684\u8def\u5f84\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u68c0\u67e5\u73af\u5883\u53d8\u91cf<\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0cPython\u7684\u5b89\u88c5\u8def\u5f84\u53ef\u80fd\u5df2\u6dfb\u52a0\u5230\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\u4e2d\uff0c\u5c24\u5176\u662f\u5728Windows\u7cfb\u7edf\u4e0a\u3002\u4f60\u53ef\u4ee5\u68c0\u67e5\u8fd9\u4e9b\u73af\u5883\u53d8\u91cf\u6765\u83b7\u53d6Python\u7684\u5b89\u88c5\u4f4d\u7f6e\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>Windows\u7cfb\u7edf<\/strong><\/li>\n<\/ol>\n<p><p>\u5728Windows\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u68c0\u67e5\u73af\u5883\u53d8\u91cf\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728\u201c\u5f00\u59cb\u201d\u83dc\u5355\u4e2d\uff0c\u53f3\u952e\u5355\u51fb\u201c\u8ba1\u7b97\u673a\u201d\u6216\u201c\u6b64\u7535\u8111\u201d\uff0c\u9009\u62e9\u201c\u5c5e\u6027\u201d\u3002<\/li>\n<li>\u5728\u201c\u7cfb\u7edf\u201d\u7a97\u53e3\u4e2d\uff0c\u5355\u51fb\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\u3002<\/li>\n<li>\u5728\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\u7a97\u53e3\u4e2d\uff0c\u5355\u51fb\u201c\u73af\u5883\u53d8\u91cf\u201d\u3002<\/li>\n<li>\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u90e8\u5206\uff0c\u67e5\u627e\u540d\u4e3a\u201cPath\u201d\u7684\u53d8\u91cf\uff0c\u5e76\u53cc\u51fb\u6253\u5f00\u3002<\/li>\n<li>\u68c0\u67e5\u8def\u5f84\u5217\u8868\u4e2d\u662f\u5426\u6709\u6307\u5411Python\u5b89\u88c5\u76ee\u5f55\u7684\u6761\u76ee\u3002<\/li>\n<\/ul>\n<ol start=\"2\">\n<li><strong>macOS\u548cLinux\u7cfb\u7edf<\/strong><\/li>\n<\/ol>\n<p><p>\u5728macOS\u548cLinux\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7\u68c0\u67e5shell\u914d\u7f6e\u6587\u4ef6\uff08\u5982<code>.bashrc<\/code>\u3001<code>.bash_profile<\/code>\u3001<code>.zshrc<\/code>\u7b49\uff09\u6765\u67e5\u770b\u662f\u5426\u6709\u6307\u5411Python\u5b89\u88c5\u8def\u5f84\u7684\u73af\u5883\u53d8\u91cf\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">cat ~\/.bashrc<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">cat ~\/.zshrc<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u67e5\u770b\u6587\u4ef6\u4e2d\u662f\u5426\u6709\u7c7b\u4f3c\u4e8e<code>export PATH=&quot;\/usr\/local\/bin\/python:$PATH&quot;<\/code>\u7684\u884c\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u603b\u7ed3<\/p>\n<\/p>\n<p><p>\u67e5\u770bPython\u7684\u5b89\u88c5\u4f4d\u7f6e\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u5b9e\u73b0\uff0c\u5305\u62ec\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u3001\u7f16\u5199Python\u811a\u672c\u3001\u5229\u7528\u73af\u5883\u7ba1\u7406\u5de5\u5177\u4ee5\u53ca\u68c0\u67e5\u73af\u5883\u53d8\u91cf\u7b49\u3002\u8fd9\u4e9b\u65b9\u6cd5\u9002\u7528\u4e8e\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u548c\u4f7f\u7528\u573a\u666f\u3002\u901a\u8fc7\u4e86\u89e3\u548c\u638c\u63e1\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u4f60\u53ef\u4ee5\u8f7b\u677e\u627e\u5230Python\u7684\u5b89\u88c5\u4f4d\u7f6e\uff0c\u4e3a\u540e\u7eed\u7684\u5f00\u53d1\u5de5\u4f5c\u505a\u597d\u51c6\u5907\u3002<\/p>\n<\/p>\n<p><p>\u6b64\u5916\uff0c\u4e86\u89e3Python\u7684\u5b89\u88c5\u4f4d\u7f6e\u8fd8\u53ef\u4ee5\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7ba1\u7406Python\u73af\u5883\uff0c\u5c24\u5176\u662f\u5728\u9700\u8981\u5904\u7406\u591a\u4e2aPython\u7248\u672c\u65f6\u3002\u65e0\u8bba\u4f60\u662fPython\u7684\u65b0\u624b\u8fd8\u662f\u7ecf\u9a8c\u4e30\u5bcc\u7684\u5f00\u53d1\u8005\uff0c\u638c\u63e1\u8fd9\u4e9b\u6280\u5de7\u90fd\u5c06\u5bf9\u4f60\u7684\u5f00\u53d1\u5de5\u4f5c\u5927\u6709\u88e8\u76ca\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u786e\u8ba4\u6211\u7535\u8111\u4e0a\u662f\u5426\u5df2\u7ecf\u5b89\u88c5\u4e86Python\uff1f<\/strong><br \/>\u8981\u786e\u8ba4\u662f\u5426\u5b89\u88c5\u4e86Python\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\u3002\u5982\u679c\u663e\u793aPython\u7684\u7248\u672c\u53f7\uff0c\u8bf4\u660e\u5df2\u6210\u529f\u5b89\u88c5\u3002\u5982\u679c\u672a\u5b89\u88c5\uff0c\u7cfb\u7edf\u4f1a\u63d0\u793a\u76f8\u5173\u4fe1\u606f\uff0c\u6307\u660e\u672a\u627e\u5230\u8be5\u547d\u4ee4\u3002<\/p>\n<p><strong>\u5982\u679c\u6211\u60f3\u5728\u591a\u4e2a\u7248\u672c\u4e4b\u95f4\u5207\u6362\uff0c\u5e94\u8be5\u600e\u4e48\u505a\uff1f<\/strong><br \/>\u4f7f\u7528\u865a\u62df\u73af\u5883\u5de5\u5177\u5982<code>venv<\/code>\u6216<code>conda<\/code>\u53ef\u4ee5\u5e2e\u52a9\u7ba1\u7406\u4e0d\u540c\u7248\u672c\u7684Python\u3002\u901a\u8fc7\u521b\u5efa\u4e0d\u540c\u7684\u865a\u62df\u73af\u5883\uff0c\u53ef\u4ee5\u5728\u6bcf\u4e2a\u73af\u5883\u4e2d\u5b89\u88c5\u7279\u5b9a\u7248\u672c\u7684Python\u53ca\u5176\u4f9d\u8d56\u5305\uff0c\u4ece\u800c\u5728\u9879\u76ee\u4e4b\u95f4\u8f7b\u677e\u5207\u6362\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u627e\u5230Python\u7684\u5b89\u88c5\u8def\u5f84\uff1f<\/strong><br \/>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u8f93\u5165<code>where python<\/code>\u6765\u67e5\u770bPython\u7684\u5b89\u88c5\u8def\u5f84\uff1b\u5728macOS\u548cLinux\u7cfb\u7edf\u4e2d\uff0c\u4f7f\u7528<code>which python<\/code>\u6216<code>which python3<\/code>\u547d\u4ee4\u53ef\u4ee5\u627e\u5230\u76f8\u5e94\u7684\u5b89\u88c5\u4f4d\u7f6e\u3002\u8fd9\u4e9b\u547d\u4ee4\u5c06\u8fd4\u56dePython\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5b8c\u6574\u8def\u5f84\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u67e5\u770bPython\u7684\u5b89\u88c5\u4f4d\u7f6e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\uff1a\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u3001\u901a\u8fc7Python\u811a\u672c\u67e5\u627e\u3001\u4f7f\u7528Pytho [&hellip;]","protected":false},"author":3,"featured_media":956640,"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\/956633"}],"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=956633"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/956633\/revisions"}],"predecessor-version":[{"id":956643,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/956633\/revisions\/956643"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/956640"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=956633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=956633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=956633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}