{"id":1092574,"date":"2025-01-08T14:22:29","date_gmt":"2025-01-08T06:22:29","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1092574.html"},"modified":"2025-01-08T14:22:31","modified_gmt":"2025-01-08T06:22:31","slug":"%e5%a6%82%e4%bd%95%e7%94%a8%e5%91%bd%e4%bb%a4%e8%a1%8c%e5%86%99python-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1092574.html","title":{"rendered":"\u5982\u4f55\u7528\u547d\u4ee4\u884c\u5199python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24205534\/c379ede1-254f-4c45-852a-faa698da9d50.webp\" alt=\"\u5982\u4f55\u7528\u547d\u4ee4\u884c\u5199python\" \/><\/p>\n<p><p> <strong>\u8981\u5728\u547d\u4ee4\u884c\u4e2d\u7f16\u5199Python\u4ee3\u7801\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ea4\u4e92\u5f0fPython\u89e3\u91ca\u5668\u3001\u6587\u672c\u7f16\u8f91\u5668\u548c\u547d\u4ee4\u884c\u5de5\u5177\u3002\u9996\u5148\uff0c\u786e\u4fdd\u60a8\u5df2\u5b89\u88c5Python\u3002\u7136\u540e\uff0c\u901a\u8fc7\u547d\u4ee4\u884c\u542f\u52a8Python\u89e3\u91ca\u5668\uff0c\u6216\u8005\u7f16\u5199Python\u811a\u672c\u5e76\u4f7f\u7528\u547d\u4ee4\u884c\u8fd0\u884c\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4ea4\u4e92\u5f0fPython\u89e3\u91ca\u5668<\/p>\n<p>\u901a\u8fc7\u547d\u4ee4\u884c\u542f\u52a8Python\u89e3\u91ca\u5668\uff0c\u60a8\u53ef\u4ee5\u7acb\u5373\u8f93\u5165\u548c\u6267\u884cPython\u4ee3\u7801\u3002\u8fd9\u79cd\u65b9\u6cd5\u975e\u5e38\u9002\u5408\u6d4b\u8bd5\u548c\u8c03\u8bd5\u4ee3\u7801\u7247\u6bb5\u3002\u542f\u52a8Python\u89e3\u91ca\u5668\u7684\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e0b\uff0c\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u60a8\u7684Python\u7248\u672c\u3002\u6b64\u65f6\uff0c\u60a8\u5c06\u8fdb\u5165\u4ea4\u4e92\u5f0fPython\u73af\u5883\uff0c\u53ef\u4ee5\u8f93\u5165\u548c\u6267\u884c\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&gt;&gt;&gt; print(&quot;Hello, World!&quot;)<\/p>\n<p>Hello, World!<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u7f16\u5199Python\u811a\u672c<\/p>\n<p>\u867d\u7136\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u65b9\u4fbf\u5feb\u6377\uff0c\u4f46\u7f16\u5199\u590d\u6742\u7684Python\u7a0b\u5e8f\u65f6\uff0c\u66f4\u63a8\u8350\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u6765\u521b\u5efaPython\u811a\u672c\u6587\u4ef6\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u7f16\u5199Python\u811a\u672c\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u6253\u5f00\u6587\u672c\u7f16\u8f91\u5668\uff08\u4f8b\u5982\uff0cVS Code\u3001Sublime Text\u3001Notepad++\u7b49\uff09\u3002<\/li>\n<li>\u7f16\u5199Python\u4ee3\u7801\u3002<\/li>\n<li>\u5c06\u6587\u4ef6\u4fdd\u5b58\u4e3a<code>.py<\/code>\u6269\u5c55\u540d\u3002<\/li>\n<\/ol>\n<p><p>\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\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884cPython\u811a\u672c<\/p>\n<p>\u7f16\u5199\u5e76\u4fdd\u5b58Python\u811a\u672c\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u8fd0\u884c\u8be5\u811a\u672c\u3002\u4ee5\u4e0b\u662f\u8fd0\u884cPython\u811a\u672c\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u7a97\u53e3\u3002<\/li>\n<li>\u5bfc\u822a\u5230Python\u811a\u672c\u6240\u5728\u7684\u76ee\u5f55\u3002<\/li>\n<li>\u4f7f\u7528\u547d\u4ee4<code>python script_name.py<\/code>\u6216<code>python3 script_name.py<\/code>\u8fd0\u884c\u811a\u672c\u3002<\/li>\n<\/ol>\n<p><p>\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u7ed3\u5408\u547d\u4ee4\u884c\u53c2\u6570\u8fd0\u884cPython\u811a\u672c<\/p>\n<p>Python\u63d0\u4f9b\u4e86<code>sys<\/code>\u6a21\u5757\uff0c\u53ef\u4ee5\u5728\u8fd0\u884c\u811a\u672c\u65f6\u4f20\u9012\u547d\u4ee4\u884c\u53c2\u6570\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528\u547d\u4ee4\u884c\u53c2\u6570\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><p>\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>greet.py<\/code>\u7684\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import sys<\/p>\n<p>if len(sys.argv) != 2:<\/p>\n<p>    print(&quot;Usage: python greet.py [name]&quot;)<\/p>\n<p>    sys.exit(1)<\/p>\n<p>name = sys.argv[1]<\/p>\n<p>print(f&quot;Hello, {name}!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd0\u884c\u811a\u672c\u5e76\u4f20\u9012\u53c2\u6570\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python greet.py Alice<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6b64\u65f6\u8f93\u51fa\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-plaintext\">Hello, Alice!<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e94\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u7ba1\u7406Python\u73af\u5883<\/p>\n<p>\u5728\u4f7f\u7528\u547d\u4ee4\u884c\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u65f6\uff0c\u7ba1\u7406Python\u73af\u5883\u548c\u4f9d\u8d56\u9879\u4e5f\u975e\u5e38\u91cd\u8981\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u547d\u4ee4\u884c\u5de5\u5177\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>pip<\/strong>\uff1aPython\u5305\u7ba1\u7406\u5668\uff0c\u7528\u4e8e\u5b89\u88c5\u548c\u7ba1\u7406Python\u5e93\u548c\u5305\u3002\u4f8b\u5982\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install requests<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>virtualenv<\/strong>\uff1a\u521b\u5efa\u9694\u79bb\u7684Python\u73af\u5883\uff0c\u4ee5\u907f\u514d\u4e0d\u540c\u9879\u76ee\u4e4b\u95f4\u7684\u4f9d\u8d56\u51b2\u7a81\u3002\u4f8b\u5982\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install virtualenv<\/p>\n<p>virtualenv myenv<\/p>\n<p>source myenv\/bin\/activate  # On Windows, use `myenv\\Scripts\\activate`<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>pipenv<\/strong>\uff1a\u4e00\u79cd\u7ed3\u5408\u4e86<code>pip<\/code>\u548c<code>virtualenv<\/code>\u7684\u5de5\u5177\uff0c\u7b80\u5316\u4e86\u4f9d\u8d56\u7ba1\u7406\u548c\u73af\u5883\u7ba1\u7406\u3002\u4f8b\u5982\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install pipenv<\/p>\n<p>pipenv install requests<\/p>\n<p>pipenv shell<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u516d\u3001\u81ea\u52a8\u5316\u4efb\u52a1<\/p>\n<p>\u5728\u547d\u4ee4\u884c\u4e2d\u7f16\u5199Python\u4ee3\u7801\u65f6\uff0c\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528\u811a\u672c\u6765\u81ea\u52a8\u5316\u4efb\u52a1\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>argparse<\/code>\u6a21\u5757\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684\u547d\u4ee4\u884c\u5de5\u5177\uff1a<\/p>\n<\/p>\n<p><p>\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>task.py<\/code>\u7684\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import argparse<\/p>\n<p>def m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n():<\/p>\n<p>    parser = argparse.ArgumentParser(description=&quot;A simple task automation script.&quot;)<\/p>\n<p>    parser.add_argument(&quot;task&quot;, help=&quot;The task to perform&quot;)<\/p>\n<p>    parser.add_argument(&quot;--count&quot;, type=int, default=1, help=&quot;Number of times to perform the task&quot;)<\/p>\n<p>    args = parser.parse_args()<\/p>\n<p>    for _ in range(args.count):<\/p>\n<p>        print(f&quot;Performing task: {args.task}&quot;)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    main()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd0\u884c\u811a\u672c\u5e76\u4f20\u9012\u53c2\u6570\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python task.py &quot;Clean the house&quot; --count 3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6b64\u65f6\u8f93\u51fa\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-plaintext\">Performing task: Clean the house<\/p>\n<p>Performing task: Clean the house<\/p>\n<p>Performing task: Clean the house<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e03\u3001\u8c03\u8bd5\u548c\u6d4b\u8bd5<\/p>\n<p>\u5728\u547d\u4ee4\u884c\u4e2d\u7f16\u5199Python\u4ee3\u7801\u65f6\uff0c\u8c03\u8bd5\u548c\u6d4b\u8bd5\u662f\u786e\u4fdd\u4ee3\u7801\u8d28\u91cf\u7684\u91cd\u8981\u6b65\u9aa4\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u8c03\u8bd5\u548c\u6d4b\u8bd5\u5de5\u5177\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>pdb<\/strong>\uff1aPython\u5185\u7f6e\u7684\u8c03\u8bd5\u5668\uff0c\u7528\u4e8e\u9010\u6b65\u6267\u884c\u4ee3\u7801\u548c\u68c0\u67e5\u53d8\u91cf\u3002\u542f\u52a8\u8c03\u8bd5\u5668\u7684\u65b9\u6cd5\u5982\u4e0b\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import pdb; pdb.set_trace()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4ee3\u7801\u4e2d\u63d2\u5165\u4e0a\u8ff0\u884c\uff0c\u8fd0\u884c\u811a\u672c\u65f6\u5c06\u8fdb\u5165\u8c03\u8bd5\u6a21\u5f0f\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>unittest<\/strong>\uff1aPython\u5185\u7f6e\u7684\u6d4b\u8bd5\u6846\u67b6\uff0c\u7528\u4e8e\u7f16\u5199\u548c\u8fd0\u884c\u6d4b\u8bd5\u7528\u4f8b\u3002\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>test_example.py<\/code>\u7684\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import unittest<\/p>\n<p>def add(a, b):<\/p>\n<p>    return a + b<\/p>\n<p>class TestAdd(unittest.TestCase):<\/p>\n<p>    def test_add(self):<\/p>\n<p>        self.assertEqual(add(2, 3), 5)<\/p>\n<p>        self.assertEqual(add(-1, 1), 0)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    unittest.main()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd0\u884c\u6d4b\u8bd5\u7528\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python -m unittest test_example.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>pytest<\/strong>\uff1a\u4e00\u79cd\u6d41\u884c\u7684\u6d4b\u8bd5\u6846\u67b6\uff0c\u63d0\u4f9b\u4e86\u66f4\u7b80\u6d01\u7684\u8bed\u6cd5\u548c\u66f4\u591a\u529f\u80fd\u3002\u4f8b\u5982\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install pytest<\/p>\n<p>pytest<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u516b\u3001\u7248\u672c\u63a7\u5236<\/p>\n<p>\u5728\u547d\u4ee4\u884c\u4e2d\u7f16\u5199Python\u4ee3\u7801\u65f6\uff0c\u4f7f\u7528\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff08\u4f8b\u5982Git\uff09\u53ef\u4ee5\u5e2e\u52a9\u60a8\u8ddf\u8e2a\u4ee3\u7801\u7684\u66f4\u6539\u548c\u534f\u4f5c\u5f00\u53d1\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684Git\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u521d\u59cb\u5316Git\u4ed3\u5e93\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">git init<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u6dfb\u52a0\u6587\u4ef6\u5230\u6682\u5b58\u533a\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">git add .<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li>\u63d0\u4ea4\u66f4\u6539\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">git commit -m &quot;Initial commit&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"4\">\n<li>\u67e5\u770b\u63d0\u4ea4\u5386\u53f2\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">git log<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"5\">\n<li>\u521b\u5efa\u548c\u5207\u6362\u5206\u652f\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">git branch new-feature<\/p>\n<p>git checkout new-feature<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"6\">\n<li>\u5408\u5e76\u5206\u652f\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">git checkout main<\/p>\n<p>git merge new-feature<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e03\u3001\u603b\u7ed3<\/p>\n<p>\u5728\u547d\u4ee4\u884c\u4e2d\u7f16\u5199Python\u4ee3\u7801\u662f\u4e00\u79cd\u9ad8\u6548\u4e14\u7075\u6d3b\u7684\u5de5\u4f5c\u65b9\u5f0f\u3002\u901a\u8fc7\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u3001\u6587\u672c\u7f16\u8f91\u5668\u3001\u547d\u4ee4\u884c\u5de5\u5177\u3001\u8c03\u8bd5\u548c\u6d4b\u8bd5\u5de5\u5177\u4ee5\u53ca\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u7f16\u5199\u3001\u8fd0\u884c\u548c\u7ba1\u7406Python\u4ee3\u7801\u3002\u65e0\u8bba\u662f\u7f16\u5199\u7b80\u5355\u7684\u811a\u672c\u8fd8\u662f\u5f00\u53d1\u590d\u6742\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u547d\u4ee4\u884c\u90fd\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u5e2e\u52a9\u60a8\u9ad8\u6548\u5730\u5b8c\u6210\u4efb\u52a1\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884cPython\u811a\u672c\uff1f<\/strong><br \/>\u8981\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884cPython\u811a\u672c\uff0c\u9996\u5148\u786e\u4fdd\u5df2\u5b89\u88c5Python\u5e76\u914d\u7f6e\u597d\u73af\u5883\u53d8\u91cf\u3002\u6253\u5f00\u547d\u4ee4\u884c\u7a97\u53e3\uff0c\u5bfc\u822a\u5230\u5305\u542bPython\u811a\u672c\u7684\u76ee\u5f55\uff0c\u8f93\u5165<code>python script_name.py<\/code>\uff08\u5c06<code>script_name.py<\/code>\u66ff\u6362\u4e3a\u4f60\u7684\u6587\u4ef6\u540d\uff09\u5e76\u6309Enter\u952e\u5373\u53ef\u6267\u884c\u811a\u672c\u3002\u5982\u679c\u4f7f\u7528\u7684\u662fPython 3\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528<code>python3<\/code>\u547d\u4ee4\u3002<\/p>\n<p><strong>\u5728\u547d\u4ee4\u884c\u4e2d\u5982\u4f55\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u6587\u4ef6\uff1f<\/strong><br \/>\u5728\u547d\u4ee4\u884c\u4e2d\u521b\u5efa\u65b0\u7684Python\u6587\u4ef6\u975e\u5e38\u7b80\u5355\u3002\u53ea\u9700\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>touch filename.py<\/code>\uff08\u5728Linux\u548cMac\u4e2d\uff09\u6216\u4f7f\u7528<code>echo &gt; filename.py<\/code>\u547d\u4ee4\uff08\u5728Windows\u4e2d\uff09\u3002\u8fd9\u6837\u5c31\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u6587\u4ef6\u3002\u63a5\u7740\uff0c\u53ef\u4ee5\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u6253\u5f00\u5e76\u7f16\u8f91\u6b64\u6587\u4ef6\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u547d\u4ee4\u884c\u4e2d\u5b89\u88c5Python\u5e93\uff1f<\/strong><br \/>\u8981\u5728\u547d\u4ee4\u884c\u4e2d\u5b89\u88c5Python\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528<code>pip<\/code>\u5de5\u5177\u3002\u8f93\u5165\u547d\u4ee4<code>pip install package_name<\/code>\uff08\u5c06<code>package_name<\/code>\u66ff\u6362\u4e3a\u4f60\u9700\u8981\u5b89\u88c5\u7684\u5e93\u540d\uff09\uff0c\u6309Enter\u952e\u5373\u53ef\u3002\u5982\u679c\u9700\u8981\u5b89\u88c5\u7279\u5b9a\u7248\u672c\u7684\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528<code>pip install package_name==version_number<\/code>\u7684\u683c\u5f0f\u3002\u786e\u4fdd\u5728\u6267\u884c\u6b64\u547d\u4ee4\u4e4b\u524d\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\u4e86Python\u548cpip\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728\u547d\u4ee4\u884c\u4e2d\u7f16\u5199Python\u4ee3\u7801\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ea4\u4e92\u5f0fPython\u89e3\u91ca\u5668\u3001\u6587\u672c\u7f16\u8f91\u5668\u548c\u547d\u4ee4\u884c\u5de5\u5177\u3002\u9996\u5148\uff0c\u786e\u4fdd\u60a8\u5df2\u5b89 [&hellip;]","protected":false},"author":3,"featured_media":1092580,"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\/1092574"}],"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=1092574"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1092574\/revisions"}],"predecessor-version":[{"id":1092582,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1092574\/revisions\/1092582"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1092580"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1092574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1092574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1092574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}