{"id":994711,"date":"2024-12-27T08:57:56","date_gmt":"2024-12-27T00:57:56","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/994711.html"},"modified":"2024-12-27T08:58:01","modified_gmt":"2024-12-27T00:58:01","slug":"%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%85%e5%92%8c%e5%90%af%e5%8a%a8python","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/994711.html","title":{"rendered":"\u5982\u4f55\u5b89\u88c5\u548c\u542f\u52a8python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25071552\/3059060e-3ec4-43a5-b350-ae5ef04059bd.webp\" alt=\"\u5982\u4f55\u5b89\u88c5\u548c\u542f\u52a8python\" \/><\/p>\n<p><p> \u5b89\u88c5\u548c\u542f\u52a8Python\u662f\u4e00\u4e2a\u76f8\u5bf9\u7b80\u5355\u7684\u8fc7\u7a0b\uff0c<strong>\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\u5b8c\u6210\uff1a\u4e0b\u8f7dPython\u5b89\u88c5\u7a0b\u5e8f\u3001\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3001\u9a8c\u8bc1\u5b89\u88c5<\/strong>\u3002\u5176\u4e2d\uff0c\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u662f\u4e00\u4e2a\u5173\u952e\u6b65\u9aa4\uff0c\u56e0\u4e3a\u8fd9\u5c06\u4f7f\u5f97\u60a8\u53ef\u4ee5\u5728\u4efb\u4f55\u547d\u4ee4\u884c\u7a97\u53e3\u4e2d\u76f4\u63a5\u8fd0\u884cPython\uff0c\u800c\u65e0\u9700\u6307\u5b9a\u5176\u5b89\u88c5\u8def\u5f84\u3002<\/p>\n<\/p>\n<p><p>\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u662f\u4e3a\u4e86\u786e\u4fdd\u8ba1\u7b97\u673a\u77e5\u9053\u5728\u54ea\u91cc\u627e\u5230Python\u53ef\u6267\u884c\u6587\u4ef6\u3002\u4ee5Windows\u4e3a\u4f8b\uff0c\u60a8\u9700\u8981\u6253\u5f00\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\uff0c\u9009\u62e9\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\uff0c\u70b9\u51fb\u201c\u73af\u5883\u53d8\u91cf\u201d\uff0c\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u4e2d\u627e\u5230\u201cPath\u201d\u53d8\u91cf\uff0c\u70b9\u51fb\u201c\u7f16\u8f91\u201d\uff0c\u7136\u540e\u5c06Python\u5b89\u88c5\u76ee\u5f55\uff08\u4f8b\u5982C:\\Python39\\\uff09\u6dfb\u52a0\u5230Path\u4e2d\u3002\u5b8c\u6210\u8fd9\u4e9b\u6b65\u9aa4\u540e\uff0c\u60a8\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u201cpython &#8211;version\u201d\u6765\u786e\u8ba4Python\u662f\u5426\u6b63\u786e\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662f\u66f4\u8be6\u7ec6\u7684\u6b65\u9aa4\u548c\u4fe1\u606f\uff0c\u4ee5\u5e2e\u52a9\u60a8\u6210\u529f\u5b89\u88c5\u548c\u542f\u52a8Python\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4e0b\u8f7d\u548c\u5b89\u88c5Python<\/h3>\n<\/p>\n<p><h4>1. \u4e0b\u8f7dPython\u5b89\u88c5\u7a0b\u5e8f<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u4ece\u5b98\u65b9\u7f51\u7ad9\uff08python.org\uff09\u4e0b\u8f7dPython\u3002Python\u6709\u591a\u4e2a\u7248\u672c\uff0c\u901a\u5e38\u5efa\u8bae\u4e0b\u8f7d\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u672c\u3002\u5982\u679c\u60a8\u662f\u521d\u5b66\u8005\uff0cPython 3\u662f\u63a8\u8350\u7684\u9009\u62e9\uff0c\u56e0\u4e3aPython 2\u5df2\u7ecf\u505c\u6b62\u652f\u6301\u3002<\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8bbf\u95ee <a href=\"https:\/\/www.python.org\/\">Python\u5b98\u65b9\u7f51\u7ad9<\/a><\/li>\n<li>\u5bfc\u822a\u5230\u201cDownloads\u201d\u9875\u9762\uff0c\u6839\u636e\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u9009\u62e9\u5408\u9002\u7684\u7248\u672c\u3002<\/li>\n<li>\u70b9\u51fb\u4e0b\u8f7d\u94fe\u63a5\uff0c\u4fdd\u5b58\u5b89\u88c5\u7a0b\u5e8f\u5230\u60a8\u7684\u8ba1\u7b97\u673a\u3002<\/li>\n<\/ul>\n<p><h4>2. \u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f<\/h4>\n<\/p>\n<p><p>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u8fd0\u884c\u4e0b\u8f7d\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<ul>\n<li>\u53cc\u51fb\u5b89\u88c5\u7a0b\u5e8f\u6587\u4ef6\uff0c\u5f00\u59cb\u5b89\u88c5\u8fc7\u7a0b\u3002<\/li>\n<li>\u5728\u5b89\u88c5\u5411\u5bfc\u4e2d\uff0c\u60a8\u4f1a\u770b\u5230\u4e00\u4e2a\u9009\u9879\u201cAdd Python to PATH\u201d\uff0c\u8bf7\u52a1\u5fc5\u9009\u4e2d\u6b64\u9009\u9879\u3002\u8fd9\u5c06\u81ea\u52a8\u914d\u7f6e\u60a8\u7684\u73af\u5883\u53d8\u91cf\u3002<\/li>\n<li>\u9009\u62e9\u201cCustomize installation\u201d\u4ee5\u67e5\u770b\u53ef\u9009\u529f\u80fd\uff0c\u901a\u5e38\u9ed8\u8ba4\u8bbe\u7f6e\u5df2\u7ecf\u8db3\u591f\u3002<\/li>\n<li>\u70b9\u51fb\u201cInstall Now\u201d\u5f00\u59cb\u5b89\u88c5\u3002<\/li>\n<\/ul>\n<p><h4>3. \u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u60a8\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u672a\u9009\u62e9\u201cAdd Python to PATH\u201d\uff0c\u53ef\u4ee5\u624b\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3002<\/p>\n<\/p>\n<ul>\n<li>\u53f3\u952e\u5355\u51fb\u201c\u6b64\u7535\u8111\u201d\u6216\u201c\u6211\u7684\u7535\u8111\u201d\uff0c\u9009\u62e9\u201c\u5c5e\u6027\u201d\u3002<\/li>\n<li>\u70b9\u51fb\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\uff0c\u7136\u540e\u70b9\u51fb\u201c\u73af\u5883\u53d8\u91cf\u201d\u3002<\/li>\n<li>\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u90e8\u5206\uff0c\u627e\u5230\u201cPath\u201d\uff0c\u5e76\u70b9\u51fb\u201c\u7f16\u8f91\u201d\u3002<\/li>\n<li>\u70b9\u51fb\u201c\u65b0\u5efa\u201d\uff0c\u5c06Python\u5b89\u88c5\u76ee\u5f55\uff08\u4f8b\u5982C:\\Python39\\\uff09\u6dfb\u52a0\u8fdb\u53bb\u3002<\/li>\n<\/ul>\n<p><h3>\u4e8c\u3001\u9a8c\u8bc1Python\u5b89\u88c5<\/h3>\n<\/p>\n<p><h4>1. \u9a8c\u8bc1\u5b89\u88c5<\/h4>\n<\/p>\n<p><p>\u6253\u5f00\u547d\u4ee4\u884c\uff08Windows\u7528\u6237\u6253\u5f00CMD\uff0cMac\u6216Linux\u7528\u6237\u6253\u5f00\u7ec8\u7aef\uff09\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u9a8c\u8bc1Python\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\u60a8\u5c06\u770b\u5230Python\u7248\u672c\u53f7\u7684\u8f93\u51fa\uff0c\u4f8b\u5982\u201cPython 3.9.7\u201d\u3002<\/p>\n<\/p>\n<p><h4>2. \u8fd0\u884cPython\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668<\/h4>\n<\/p>\n<p><p>\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u201cpython\u201d\uff0c\u60a8\u5c06\u8fdb\u5165Python\u7684\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u3002\u8fd9\u662f\u4e00\u4e2a\u53ef\u4ee5\u5b9e\u65f6\u8f93\u5165\u548c\u6267\u884cPython\u4ee3\u7801\u7684\u73af\u5883\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u60a8\u4f1a\u770b\u5230\u7c7b\u4f3c\u4e8e\u4ee5\u4e0b\u7684\u63d0\u793a\u7b26\uff1a<\/p>\n<\/p>\n<p><pre><code>Python 3.9.7 (default, Aug 31 2021, 13:28:12) <\/p>\n<p>[GCC 8.3.0] on linux<\/p>\n<p>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.<\/p>\n<p>&gt;&gt;&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u91cc\uff0c\u60a8\u53ef\u4ee5\u8f93\u5165Python\u4ee3\u7801\u5e76\u7acb\u5373\u67e5\u770b\u7ed3\u679c\u3002\u4f8b\u5982\uff0c\u8f93\u5165\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\u6309\u56de\u8f66\u952e\uff0c\u60a8\u5c06\u770b\u5230\u8f93\u51fa\uff1a<\/p>\n<\/p>\n<p><pre><code>Hello, World!<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u5b89\u88c5Python\u5305\u7ba1\u7406\u5de5\u5177<\/h3>\n<\/p>\n<p><h4>1. \u4f7f\u7528pip<\/h4>\n<\/p>\n<p><p>pip\u662fPython\u7684\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u901a\u5e38\u4f1a\u4e0ePython\u4e00\u8d77\u5b89\u88c5\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528pip\u6765\u5b89\u88c5\u5176\u4ed6Python\u5305\u548c\u5e93\u3002<\/p>\n<\/p>\n<ul>\n<li>\u9a8c\u8bc1pip\u662f\u5426\u5df2\u7ecf\u5b89\u88c5\uff1a\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u201cpip &#8211;version\u201d\uff0c\u786e\u8ba4\u8f93\u51fa\u7c7b\u4f3c\u4e8e\u201cpip 21.2.4\u201d\u3002<\/li>\n<\/ul>\n<p><h4>2. \u5b89\u88c5Python\u5305<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528pip\u5b89\u88c5Python\u5305\u975e\u5e38\u7b80\u5355\u3002\u4f8b\u5982\uff0c\u5b89\u88c5\u201crequests\u201d\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install requests<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u81ea\u52a8\u4e0b\u8f7d\u5e76\u5b89\u88c5requests\u5e93\u53ca\u5176\u4f9d\u8d56\u9879\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u7684\u9009\u62e9\u548c\u5b89\u88c5<\/h3>\n<\/p>\n<p><h4>1. \u9009\u62e9\u5408\u9002\u7684IDE<\/h4>\n<\/p>\n<p><p>\u867d\u7136\u60a8\u53ef\u4ee5\u4f7f\u7528\u4efb\u4f55\u6587\u672c\u7f16\u8f91\u5668\u7f16\u5199Python\u4ee3\u7801\uff0c\u4f46\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u751f\u4ea7\u529b\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6d41\u884c\u7684Python IDE\uff1a<\/p>\n<\/p>\n<ul>\n<li>PyCharm\uff1a\u529f\u80fd\u9f50\u5168\u7684Python IDE\uff0c\u652f\u6301\u8c03\u8bd5\u3001\u8bed\u6cd5\u9ad8\u4eae\u3001\u667a\u80fd\u63d0\u793a\u7b49\u3002<\/li>\n<li>VSCode\uff1a\u8f7b\u91cf\u7ea7\u7f16\u8f91\u5668\uff0c\u901a\u8fc7\u63d2\u4ef6\u652f\u6301Python\u5f00\u53d1\u3002<\/li>\n<li>Jupyter Notebook\uff1a\u9002\u5408\u6570\u636e\u5206\u6790\u548c\u79d1\u5b66\u8ba1\u7b97\u7684\u4ea4\u4e92\u5f0f\u5f00\u53d1\u73af\u5883\u3002<\/li>\n<\/ul>\n<p><h4>2. \u5b89\u88c5\u548c\u914d\u7f6eIDE<\/h4>\n<\/p>\n<p><p>\u4ee5PyCharm\u4e3a\u4f8b\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u4e0b\u8f7d\uff1a\u8bbf\u95ee <a href=\"https:\/\/www.jetbrains.com\/pycharm\/\">JetBr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>ns PyCharm\u5b98\u7f51<\/a>\u5e76\u4e0b\u8f7d\u793e\u533a\u7248\u3002<\/li>\n<li>\u5b89\u88c5\uff1a\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\uff0c\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5b89\u88c5\u3002<\/li>\n<li>\u914d\u7f6e\uff1a\u9996\u6b21\u542f\u52a8\u65f6\uff0c\u60a8\u53ef\u4ee5\u9009\u62e9\u5bfc\u5165\u8bbe\u7f6e\u6216\u4f7f\u7528\u9ed8\u8ba4\u8bbe\u7f6e\u3002\u5efa\u8bae\u914d\u7f6ePython\u89e3\u91ca\u5668\u4e3a\u60a8\u5df2\u5b89\u88c5\u7684Python\u7248\u672c\u3002<\/li>\n<\/ul>\n<p><h3>\u4e94\u3001\u7f16\u5199\u548c\u8fd0\u884cPython\u7a0b\u5e8f<\/h3>\n<\/p>\n<p><h4>1. \u7f16\u5199\u7b2c\u4e00\u4e2aPython\u7a0b\u5e8f<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528\u60a8\u9009\u62e9\u7684IDE\u6216\u6587\u672c\u7f16\u8f91\u5668\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6\uff0c\u547d\u540d\u4e3a\u201chello.py\u201d\u3002\u5728\u6587\u4ef6\u4e2d\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def main():<\/p>\n<p>    print(&quot;Hello, World!&quot;)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    main()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u8fd0\u884cPython\u7a0b\u5e8f<\/h4>\n<\/p>\n<p><p>\u4fdd\u5b58\u6587\u4ef6\u540e\uff0c\u5728\u547d\u4ee4\u884c\u4e2d\u5bfc\u822a\u5230\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\uff0c\u7136\u540e\u8fd0\u884c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u60a8\u5c06\u770b\u5230\u8f93\u51fa\uff1a<\/p>\n<\/p>\n<p><pre><code>Hello, World!<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u89e3\u51b3\u5e38\u89c1\u95ee\u9898<\/h3>\n<\/p>\n<p><h4>1. Python\u672a\u6dfb\u52a0\u5230PATH<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u201cpython\u201d\u65f6\u51fa\u73b0\u201c\u672a\u8bc6\u522b\u7684\u547d\u4ee4\u201d\u9519\u8bef\uff0c\u901a\u5e38\u662f\u56e0\u4e3aPython\u672a\u88ab\u6b63\u786e\u6dfb\u52a0\u5230\u7cfb\u7edfPATH\u4e2d\u3002\u8bf7\u53c2\u8003\u524d\u9762\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u7684\u6b65\u9aa4\u8fdb\u884c\u4fee\u590d\u3002<\/p>\n<\/p>\n<p><h4>2. pip\u547d\u4ee4\u4e0d\u53ef\u7528<\/h4>\n<\/p>\n<p><p>\u5982\u679cpip\u547d\u4ee4\u4e0d\u53ef\u7528\uff0c\u53ef\u80fd\u662f\u7531\u4e8epip\u672a\u5b89\u88c5\u6216\u672a\u6dfb\u52a0\u5230PATH\u3002\u53ef\u4ee5\u5c1d\u8bd5\u91cd\u65b0\u5b89\u88c5Python\uff0c\u5e76\u786e\u4fdd\u9009\u62e9\u201cAdd Python to PATH\u201d\u3002<\/p>\n<\/p>\n<p><h4>3. \u7248\u672c\u51b2\u7a81<\/h4>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u8ba1\u7b97\u673a\u4e0a\u53ef\u80fd\u4f1a\u6709\u591a\u4e2aPython\u7248\u672c\uff0c\u5bfc\u81f4\u7248\u672c\u51b2\u7a81\u3002\u53ef\u4ee5\u901a\u8fc7\u660e\u786e\u6307\u5b9a\u7248\u672c\u6765\u8fd0\u884cPython\uff0c\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3.9 hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e03\u3001\u5b66\u4e60Python\u7684\u4e0b\u4e00\u6b65<\/h3>\n<\/p>\n<p><h4>1. \u5b66\u4e60Python\u57fa\u7840<\/h4>\n<\/p>\n<p><p>\u5728\u6210\u529f\u5b89\u88c5\u548c\u8fd0\u884cPython\u540e\uff0c\u60a8\u53ef\u4ee5\u5f00\u59cb\u5b66\u4e60Python\u7684\u57fa\u672c\u8bed\u6cd5\u548c\u6982\u5ff5\u3002\u4f8b\u5982\uff0c\u5b66\u4e60\u53d8\u91cf\u3001\u6570\u636e\u7c7b\u578b\u3001\u63a7\u5236\u6d41\u3001\u51fd\u6570\u3001\u7c7b\u548c\u5bf9\u8c61\u7b49\u3002<\/p>\n<\/p>\n<p><h4>2. \u53c2\u4e0e\u5728\u7ebf\u8bfe\u7a0b\u548c\u793e\u533a<\/h4>\n<\/p>\n<p><p>\u6709\u5f88\u591a\u5728\u7ebf\u8d44\u6e90\u53ef\u4ee5\u5e2e\u52a9\u60a8\u5b66\u4e60Python\uff0c\u5305\u62ecCoursera\u3001edX\u3001Udemy\u7b49\u5e73\u53f0\u63d0\u4f9b\u7684\u8bfe\u7a0b\u3002\u6b64\u5916\uff0c\u53c2\u4e0ePython\u793e\u533a\uff08\u5982Reddit\u7684r\/learnpython\uff09\u53ef\u4ee5\u5e2e\u52a9\u60a8\u4ea4\u6d41\u7ecf\u9a8c\u548c\u83b7\u5f97\u652f\u6301\u3002<\/p>\n<\/p>\n<p><h4>3. \u5b9e\u8df5\u548c\u9879\u76ee<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7\u53c2\u4e0e\u5b9e\u9645\u9879\u76ee\u6765\u5de9\u56fa\u60a8\u7684Python\u6280\u80fd\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u5f00\u53d1\u4e00\u4e2a\u7b80\u5355\u7684Web\u5e94\u7528\u3001\u6570\u636e\u5206\u6790\u9879\u76ee\u6216\u81ea\u52a8\u5316\u811a\u672c\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u60a8\u5c06\u80fd\u591f\u6210\u529f\u5b89\u88c5\u548c\u542f\u52a8Python\uff0c\u5e76\u4e3a\u672a\u6765\u7684\u5b66\u4e60\u548c\u5f00\u53d1\u6253\u4e0b\u575a\u5b9e\u7684\u57fa\u7840\u3002\u65e0\u8bba\u60a8\u662f\u7f16\u7a0b\u65b0\u624b\u8fd8\u662f\u7ecf\u9a8c\u4e30\u5bcc\u7684\u5f00\u53d1\u8005\uff0cPython\u90fd\u662f\u4e00\u4e2a\u5f3a\u5927\u4e14\u6613\u4e8e\u5b66\u4e60\u7684\u8bed\u8a00\uff0c\u53ef\u4ee5\u5e2e\u52a9\u60a8\u5728\u591a\u4e2a\u9886\u57df\u53d6\u5f97\u8fdb\u5c55\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u9009\u62e9\u9002\u5408\u7684Python\u7248\u672c\u8fdb\u884c\u5b89\u88c5\uff1f<\/strong><br \/>\u5728\u9009\u62e9Python\u7248\u672c\u65f6\uff0c\u5efa\u8bae\u8003\u8651\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u548c\u4f7f\u7528\u9700\u6c42\u3002\u5bf9\u4e8e\u5927\u591a\u6570\u7528\u6237\u6765\u8bf4\uff0c\u6700\u65b0\u7684\u7a33\u5b9a\u7248Python\u662f\u6700\u4f73\u9009\u62e9\u3002\u8bbf\u95eePython\u5b98\u7f51\uff08python.org\uff09\uff0c\u53ef\u4ee5\u67e5\u770b\u5f53\u524d\u7684\u7248\u672c\u4fe1\u606f\uff0c\u5e76\u4e0b\u8f7d\u9002\u5408\u60a8\u64cd\u4f5c\u7cfb\u7edf\uff08Windows\u3001macOS\u3001Linux\uff09\u7684\u5b89\u88c5\u5305\u3002\u5982\u679c\u60a8\u9700\u8981\u517c\u5bb9\u65e7\u9879\u76ee\uff0c\u53ef\u4ee5\u9009\u62e9\u5b89\u88c5\u65e7\u7248\u672c\uff0c\u4f46\u8981\u6ce8\u610f\u5b89\u5168\u6027\u548c\u652f\u6301\u6027\u3002<\/p>\n<p><strong>\u5728Windows\u4e0a\u5b89\u88c5Python\u65f6\u9700\u8981\u6ce8\u610f\u54ea\u4e9b\u6b65\u9aa4\uff1f<\/strong><br \/>\u5728Windows\u7cfb\u7edf\u4e0a\u5b89\u88c5Python\u65f6\uff0c\u786e\u4fdd\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\u3002\u8fd9\u4e00\u6b65\u9aa4\u5c06\u81ea\u52a8\u5c06Python\u6dfb\u52a0\u5230\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u4e2d\uff0c\u65b9\u4fbf\u540e\u7eed\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u4f7f\u7528\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165<code>python --version<\/code>\u6765\u786e\u8ba4\u662f\u5426\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Linux\u7cfb\u7edf\u4e2d\u901a\u8fc7\u547d\u4ee4\u884c\u5b89\u88c5Python\uff1f<\/strong><br \/>\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u53ef\u4ee5\u65b9\u4fbf\u5730\u5b89\u88c5Python\u3002\u5bf9\u4e8eDebian\u6216Ubuntu\u7cfb\u7edf\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<code>sudo apt update<\/code>\u548c<code>sudo apt install python3<\/code>\u3002\u5bf9\u4e8eRed Hat\u6216CentOS\uff0c\u4f7f\u7528<code>sudo yum install python3<\/code>\u3002\u5b89\u88c5\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4<code>python3 --version<\/code>\u6765\u68c0\u67e5\u5b89\u88c5\u60c5\u51b5\u3002\u786e\u4fdd\u60a8\u7684\u7cfb\u7edf\u5df2\u8fde\u63a5\u4e92\u8054\u7f51\uff0c\u4ee5\u987a\u5229\u4e0b\u8f7d\u548c\u5b89\u88c5\u6240\u9700\u6587\u4ef6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5b89\u88c5\u548c\u542f\u52a8Python\u662f\u4e00\u4e2a\u76f8\u5bf9\u7b80\u5355\u7684\u8fc7\u7a0b\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\u5b8c\u6210\uff1a\u4e0b\u8f7dPython\u5b89\u88c5\u7a0b\u5e8f\u3001\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u3001 [&hellip;]","protected":false},"author":3,"featured_media":994729,"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\/994711"}],"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=994711"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/994711\/revisions"}],"predecessor-version":[{"id":994732,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/994711\/revisions\/994732"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/994729"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=994711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=994711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=994711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}