{"id":1116074,"date":"2025-01-08T18:13:05","date_gmt":"2025-01-08T10:13:05","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1116074.html"},"modified":"2025-01-08T18:13:08","modified_gmt":"2025-01-08T10:13:08","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8%e5%91%bd%e4%bb%a4%e8%a1%8c%e8%bf%90%e8%a1%8cpython%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1116074.html","title":{"rendered":"\u5982\u4f55\u5728\u547d\u4ee4\u884c\u8fd0\u884cpython\u811a\u672c"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25080550\/dd7437a4-7e17-49bd-825a-886d5eb58075.webp\" alt=\"\u5982\u4f55\u5728\u547d\u4ee4\u884c\u8fd0\u884cpython\u811a\u672c\" \/><\/p>\n<p><p> <strong>\u5728\u547d\u4ee4\u884c\u8fd0\u884cPython\u811a\u672c\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u5b89\u88c5Python\u3001\u4f7f\u7528\u6b63\u786e\u7684\u547d\u4ee4\u3001\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u3001\u786e\u4fdd\u811a\u672c\u6587\u4ef6\u6709\u6267\u884c\u6743\u9650<\/strong>\u3002\u5176\u4e2d\uff0c\u786e\u4fdd\u811a\u672c\u6587\u4ef6\u6709\u6267\u884c\u6743\u9650\u5bf9\u4e8e\u5728Linux\u6216MacOS\u7cfb\u7edf\u4e0a\u8fd0\u884cPython\u811a\u672c\u975e\u5e38\u91cd\u8981\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u901a\u8fc7\u547d\u4ee4\u884c\u8fd0\u884cPython\u811a\u672c\u7684\u5177\u4f53\u6b65\u9aa4\u548c\u6ce8\u610f\u4e8b\u9879\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u5b89\u88c5Python<\/p>\n<\/p>\n<p><p>\u5728\u8fd0\u884cPython\u811a\u672c\u4e4b\u524d\uff0c\u786e\u4fdd\u60a8\u7684\u8ba1\u7b97\u673a\u4e0a\u5df2\u5b89\u88c5Python\u3002\u60a8\u53ef\u4ee5\u4ecePython\u7684\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u7684Python\u3002\u5b89\u88c5\u8fc7\u7a0b\u76f8\u5bf9\u7b80\u5355\uff0c\u53ea\u9700\u6309\u7167\u63d0\u793a\u64cd\u4f5c\u5373\u53ef\u3002<\/p>\n<\/p>\n<p><p>1\u3001Windows\u7cfb\u7edf<\/p>\n<\/p>\n<p><p>\u5728Windows\u7cfb\u7edf\u4e0a\uff0c\u4e0b\u8f7d\u5e76\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u65f6\uff0c\u786e\u4fdd\u9009\u4e2d\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u8fd9\u6837\u53ef\u4ee5\u81ea\u52a8\u5c06Python\u6dfb\u52a0\u5230\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\u4e2d\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u68c0\u67e5\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u5b89\u88c5\u6210\u529f\uff0c\u4f1a\u663e\u793a\u5f53\u524d\u5b89\u88c5\u7684Python\u7248\u672c\u53f7\u3002<\/p>\n<\/p>\n<p><p>2\u3001MacOS\u7cfb\u7edf<\/p>\n<\/p>\n<p><p>\u5728MacOS\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7Homebrew\u5b89\u88c5Python\u3002\u9996\u5148\uff0c\u786e\u4fdd\u60a8\u7684\u7cfb\u7edf\u4e0a\u5df2\u5b89\u88c5Homebrew\uff0c\u7136\u540e\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">brew install python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5Python\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>3\u3001Linux\u7cfb\u7edf<\/p>\n<\/p>\n<p><p>\u5728\u5927\u591a\u6570Linux\u53d1\u884c\u7248\u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u5b89\u88c5Python\u3002\u4f8b\u5982\uff0c\u5728Ubuntu\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo apt-get update<\/p>\n<p>sudo apt-get install python3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5Python\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e8c\u3001\u7f16\u5199Python\u811a\u672c<\/p>\n<\/p>\n<p><p>\u5728\u547d\u4ee4\u884c\u8fd0\u884cPython\u811a\u672c\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u7f16\u5199\u4e00\u4e2aPython\u811a\u672c\u6587\u4ef6\u3002\u53ef\u4ee5\u4f7f\u7528\u4efb\u4f55\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982Notepad\u3001Sublime Text\u3001Visual Studio Code\u7b49\uff09\u7f16\u5199Python\u811a\u672c\u3002\u5c06\u811a\u672c\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>\u4e09\u3001\u8fd0\u884cPython\u811a\u672c<\/p>\n<\/p>\n<p><p>1\u3001Windows\u7cfb\u7edf<\/p>\n<\/p>\n<p><p>\u5728Windows\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u63d0\u793a\u7b26\uff08cmd\uff09\u6216PowerShell\u8fd0\u884cPython\u811a\u672c\u3002\u9996\u5148\uff0c\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u6216PowerShell\uff0c\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u8fdb\u5165\u5b58\u653ePython\u811a\u672c\u7684\u76ee\u5f55\u3002\u4f8b\u5982\uff0c\u5982\u679c\u811a\u672c\u4fdd\u5b58\u5728<code>C:\\Scripts<\/code>\u76ee\u5f55\u4e0b\uff0c\u53ef\u4ee5\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">cd C:\\Scripts<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884cPython\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u811a\u672c\u4e2d\u6ca1\u6709\u8bed\u6cd5\u9519\u8bef\uff0c\u547d\u4ee4\u884c\u5c06\u8f93\u51fa\u201cHello, World!\u201d\u3002<\/p>\n<\/p>\n<p><p>2\u3001MacOS\u548cLinux\u7cfb\u7edf<\/p>\n<\/p>\n<p><p>\u5728MacOS\u548cLinux\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7\u7ec8\u7aef\u8fd0\u884cPython\u811a\u672c\u3002\u9996\u5148\uff0c\u6253\u5f00\u7ec8\u7aef\uff0c\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u8fdb\u5165\u5b58\u653ePython\u811a\u672c\u7684\u76ee\u5f55\u3002\u4f8b\u5982\uff0c\u5982\u679c\u811a\u672c\u4fdd\u5b58\u5728<code>~\/Scripts<\/code>\u76ee\u5f55\u4e0b\uff0c\u53ef\u4ee5\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">cd ~\/Scripts<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884cPython\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u811a\u672c\u4e2d\u6ca1\u6709\u8bed\u6cd5\u9519\u8bef\uff0c\u7ec8\u7aef\u5c06\u8f93\u51fa\u201cHello, World!\u201d\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/p>\n<\/p>\n<p><p>\u4e3a\u4e86\u65b9\u4fbf\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884cPython\u811a\u672c\uff0c\u53ef\u4ee5\u5c06Python\u6dfb\u52a0\u5230\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\u4e2d\u3002\u5728Windows\u7cfb\u7edf\u4e0a\uff0c\u5b89\u88c5Python\u65f6\u9009\u4e2d\u201cAdd Python to PATH\u201d\u9009\u9879\u5373\u53ef\u3002\u5728MacOS\u548cLinux\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u624b\u52a8\u5c06Python\u6dfb\u52a0\u5230\u73af\u5883\u53d8\u91cf\u4e2d\u3002<\/p>\n<\/p>\n<p><p>1\u3001MacOS\u7cfb\u7edf<\/p>\n<\/p>\n<p><p>\u5728MacOS\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u7f16\u8f91<code>.bash_profile<\/code>\u6216<code>.zshrc<\/code>\u6587\u4ef6\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">export PATH=&quot;\/usr\/local\/bin\/python3:$PATH&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u4f7f\u66f4\u6539\u751f\u6548\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">source ~\/.bash_profile<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>2\u3001Linux\u7cfb\u7edf<\/p>\n<\/p>\n<p><p>\u5728Linux\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u7f16\u8f91<code>.bashrc<\/code>\u6216<code>.profile<\/code>\u6587\u4ef6\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">export PATH=&quot;\/usr\/bin\/python3:$PATH&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u4f7f\u66f4\u6539\u751f\u6548\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">source ~\/.bashrc<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e94\u3001\u786e\u4fdd\u811a\u672c\u6587\u4ef6\u6709\u6267\u884c\u6743\u9650<\/p>\n<\/p>\n<p><p>\u5728MacOS\u548cLinux\u7cfb\u7edf\u4e0a\uff0c\u786e\u4fddPython\u811a\u672c\u6587\u4ef6\u6709\u6267\u884c\u6743\u9650\u975e\u5e38\u91cd\u8981\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4e3a\u811a\u672c\u6587\u4ef6\u6dfb\u52a0\u6267\u884c\u6743\u9650\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">chmod +x hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c\u811a\u672c\u6587\u4ef6\uff0c\u800c\u4e0d\u9700\u8981\u663e\u5f0f\u8c03\u7528Python\u89e3\u91ca\u5668\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">.\/hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6837\uff0c\u811a\u672c\u6587\u4ef6\u5c06\u4ee5\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5f62\u5f0f\u8fd0\u884c\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001\u4f7f\u7528\u865a\u62df\u73af\u5883<\/p>\n<\/p>\n<p><p>\u5728\u5f00\u53d1Python\u9879\u76ee\u65f6\uff0c\u5efa\u8bae\u4f7f\u7528\u865a\u62df\u73af\u5883\u6765\u9694\u79bb\u9879\u76ee\u7684\u4f9d\u8d56\u5173\u7cfb\u3002\u53ef\u4ee5\u4f7f\u7528<code>venv<\/code>\u6a21\u5757\u521b\u5efa\u865a\u62df\u73af\u5883\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>myenv<\/code>\u7684\u865a\u62df\u73af\u5883\uff0c\u5e76\u6fc0\u6d3b\u5b83\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 -m venv myenv<\/p>\n<p>source myenv\/bin\/activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u6fc0\u6d3b\u865a\u62df\u73af\u5883\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7<code>pip<\/code>\u5b89\u88c5\u9879\u76ee\u6240\u9700\u7684\u4f9d\u8d56\u5305\uff0c\u5e76\u8fd0\u884cPython\u811a\u672c\u3002\u8981\u9000\u51fa\u865a\u62df\u73af\u5883\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">deactivate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e03\u3001\u4f7f\u7528Shebang<\/p>\n<\/p>\n<p><p>\u5728MacOS\u548cLinux\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u5728\u811a\u672c\u6587\u4ef6\u7684\u7b2c\u4e00\u884c\u6dfb\u52a0Shebang\uff0c\u4ee5\u6307\u5b9a\u89e3\u91ca\u5668\u3002\u8fd9\u6837\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c\u811a\u672c\u6587\u4ef6\uff0c\u800c\u4e0d\u9700\u8981\u663e\u5f0f\u8c03\u7528Python\u89e3\u91ca\u5668\u3002\u4f8b\u5982\uff0c\u7f16\u8f91<code>hello.py<\/code>\u6587\u4ef6\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">#!\/usr\/bin\/env python3<\/p>\n<p>print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u6dfb\u52a0\u6267\u884c\u6743\u9650\u5e76\u8fd0\u884c\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">chmod +x hello.py<\/p>\n<p>.\/hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u516b\u3001\u8c03\u8bd5Python\u811a\u672c<\/p>\n<\/p>\n<p><p>\u5728\u5f00\u53d1\u548c\u8c03\u8bd5Python\u811a\u672c\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528Python\u7684\u5185\u7f6e\u8c03\u8bd5\u5668\uff08<code>pdb<\/code>\uff09\u6216\u5176\u4ed6\u8c03\u8bd5\u5de5\u5177\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5728\u811a\u672c\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\u4ee5\u542f\u7528\u8c03\u8bd5\u5668\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pdb; pdb.set_trace()<\/p>\n<p>print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd0\u884c\u811a\u672c\u65f6\uff0c\u5c06\u8fdb\u5165\u8c03\u8bd5\u6a21\u5f0f\uff0c\u5141\u8bb8\u9010\u6b65\u6267\u884c\u4ee3\u7801\u5e76\u68c0\u67e5\u53d8\u91cf\u7684\u503c\u3002<\/p>\n<\/p>\n<p><p>\u4e5d\u3001\u8fd0\u884c\u4ea4\u4e92\u5f0fPython\u4f1a\u8bdd<\/p>\n<\/p>\n<p><p>\u9664\u4e86\u8fd0\u884c\u811a\u672c\u6587\u4ef6\u5916\uff0c\u8fd8\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u542f\u52a8\u4ea4\u4e92\u5f0fPython\u4f1a\u8bdd\uff0c\u4ee5\u4fbf\u5feb\u901f\u6d4b\u8bd5\u4ee3\u7801\u7247\u6bb5\u3002\u53ea\u9700\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216\u5728MacOS\u548cLinux\u7cfb\u7edf\u4e0a\u8f93\u5165\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6837\u5c06\u542f\u52a8Python\u89e3\u91ca\u5668\u7684\u4ea4\u4e92\u5f0f\u4f1a\u8bdd\uff0c\u60a8\u53ef\u4ee5\u5728\u5176\u4e2d\u8f93\u5165Python\u4ee3\u7801\u5e76\u7acb\u5373\u67e5\u770b\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><p>\u603b\u7ed3<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u60a8\u5e94\u8be5\u5df2\u7ecf\u638c\u63e1\u4e86\u5728\u547d\u4ee4\u884c\u8fd0\u884cPython\u811a\u672c\u7684\u57fa\u672c\u65b9\u6cd5\u548c\u6280\u5de7\u3002\u65e0\u8bba\u662f\u5728Windows\u3001MacOS\u8fd8\u662fLinux\u7cfb\u7edf\u4e0a\uff0c\u53ea\u9700\u6309\u7167\u4e0a\u8ff0\u6b65\u9aa4\u64cd\u4f5c\uff0c\u5373\u53ef\u8f7b\u677e\u8fd0\u884cPython\u811a\u672c\u3002\u6b64\u5916\uff0c\u4f7f\u7528\u865a\u62df\u73af\u5883\u3001Shebang\u548c\u8c03\u8bd5\u5de5\u5177\u7b49\u9ad8\u7ea7\u6280\u5de7\uff0c\u53ef\u4ee5\u8fdb\u4e00\u6b65\u63d0\u5347\u60a8\u7684\u5f00\u53d1\u6548\u7387\u548c\u4ee3\u7801\u8d28\u91cf\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5728\u547d\u4ee4\u884c\u4e2d\u5982\u4f55\u5b9a\u4f4d\u5230Python\u811a\u672c\u6240\u5728\u7684\u6587\u4ef6\u5939\uff1f<\/strong><br \/>\u8981\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884cPython\u811a\u672c\uff0c\u60a8\u9700\u8981\u9996\u5148\u5b9a\u4f4d\u5230\u8be5\u811a\u672c\u7684\u6587\u4ef6\u5939\u3002\u53ef\u4ee5\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\uff08Change Directory\uff09\u6765\u66f4\u6539\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u3002\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u7684\u811a\u672c\u4f4d\u4e8e<code>C:\\Users\\YourName\\Documents<\/code>\uff0c\u53ef\u4ee5\u8f93\u5165<code>cd C:\\Users\\YourName\\Documents<\/code>\u3002\u786e\u4fdd\u5728\u8def\u5f84\u4e2d\u4f7f\u7528\u53cc\u5f15\u53f7\uff0c\u5982\u679c\u8def\u5f84\u4e2d\u5305\u542b\u7a7a\u683c\u3002<\/p>\n<p><strong>\u5982\u4f55\u786e\u4fdd\u547d\u4ee4\u884c\u4e2d\u5df2\u5b89\u88c5Python\uff1f<\/strong><br \/>\u5728\u8fd0\u884cPython\u811a\u672c\u4e4b\u524d\uff0c\u786e\u8ba4\u60a8\u7684\u7cfb\u7edf\u4e2d\u5df2\u5b89\u88c5Python\u3002\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\u6765\u68c0\u67e5\u3002\u5982\u679c\u8fd4\u56de\u4e86Python\u7684\u7248\u672c\u53f7\uff0c\u8bf4\u660e\u5df2\u6210\u529f\u5b89\u88c5\u3002\u5982\u679c\u672a\u5b89\u88c5\uff0c\u8bf7\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5\u9002\u5408\u60a8\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\u3002<\/p>\n<p><strong>\u5982\u4f55\u5904\u7406Python\u811a\u672c\u4e2d\u7684\u9519\u8bef\u4fe1\u606f\uff1f<\/strong><br \/>\u5982\u679c\u5728\u8fd0\u884cPython\u811a\u672c\u65f6\u9047\u5230\u9519\u8bef\uff0c\u547d\u4ee4\u884c\u5c06\u663e\u793a\u9519\u8bef\u4fe1\u606f\u3002\u4ed4\u7ec6\u9605\u8bfb\u8fd9\u4e9b\u4fe1\u606f\uff0c\u5b83\u901a\u5e38\u4f1a\u6307\u793a\u51fa\u95ee\u9898\u6240\u5728\u7684\u884c\u53f7\u548c\u9519\u8bef\u7c7b\u578b\u3002\u5e38\u89c1\u7684\u9519\u8bef\u5305\u62ec\u8bed\u6cd5\u9519\u8bef\u3001\u672a\u5b9a\u4e49\u53d8\u91cf\u7b49\u3002\u6839\u636e\u63d0\u793a\u8fdb\u884c\u4fee\u6b63\u540e\uff0c\u518d\u6b21\u8fd0\u884c\u811a\u672c\u4ee5\u786e\u8ba4\u95ee\u9898\u662f\u5426\u89e3\u51b3\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728\u547d\u4ee4\u884c\u8fd0\u884cPython\u811a\u672c\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u5b89\u88c5Python\u3001\u4f7f\u7528\u6b63\u786e\u7684\u547d\u4ee4\u3001\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u3001\u786e\u4fdd\u811a\u672c\u6587\u4ef6\u6709\u6267\u884c\u6743\u9650 [&hellip;]","protected":false},"author":3,"featured_media":1116080,"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\/1116074"}],"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=1116074"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1116074\/revisions"}],"predecessor-version":[{"id":1116083,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1116074\/revisions\/1116083"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1116080"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1116074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1116074"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1116074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}