{"id":204988,"date":"2025-05-29T11:41:04","date_gmt":"2025-05-29T03:41:04","guid":{"rendered":"https:\/\/server.hk\/cnblog\/204988\/"},"modified":"2025-05-29T11:41:04","modified_gmt":"2025-05-29T03:41:04","slug":"python-%e5%ae%89%e8%a3%85-requests-%e9%81%87%e5%88%b0unknown-command-install-upgrade-%e9%94%99%e8%af%af%e8%af%a5%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/204988\/","title":{"rendered":"Python \u5b89\u88c5 requests \u9047\u5230\u201cunknown command \\&#8221;install-upgrade\\&#8221;\\&#8221; \u9519\u8bef\u8be5\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>Python \u5b89\u88c5 requests \u9047\u5230\u201cunknown command \\&#8221;install-upgrade\\&#8221;\\&#8221; \u9519\u8bef\u8be5\u5982\u4f55\u89e3\u51b3\uff1f<\/h1>\n<p>\u6765\u5230\u7684\u5927\u5bb6\uff0c\u76f8\u4fe1\u90fd\u662f\u7f16\u7a0b\u5b66\u4e60\u7231\u597d\u8005\uff0c\u5e0c\u671b\u5728\u8fd9\u91cc\u5b66\u4e60\u6587\u7ae0\u76f8\u5173\u7f16\u7a0b\u77e5\u8bc6\u3002\u4e0b\u9762\u672c\u7bc7\u6587\u7ae0\u5c31\u6765\u5e26\u5927\u5bb6\u804a\u804a\u300aPython \u5b89\u88c5 requests \u9047\u5230\u201cunknown command \\&#8221;install-upgrade\\&#8221;\\&#8221; \u9519\u8bef\u8be5\u5982\u4f55\u89e3\u51b3\uff1f\u300b\uff0c\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u77e5\u8bc6\u79ef\u7d2f\u6709\u6240\u5e2e\u52a9\uff0c\u52a9\u529b\u5b9e\u6218\u5f00\u53d1\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241120\/1732113571673df4a36a2bb.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>python \u5b89\u88c5requests \u63d0\u793a\u9519\u8bef<\/strong><\/p>\n<p>\u5728\u547d\u4ee4\u884c\u5b89\u88c5 requests \u6a21\u5757\u65f6\uff0c\u6709\u65f6\u4f1a\u9047\u5230\u4ee5\u4e0b\u9519\u8bef\uff1a<\/p>\n<blockquote><p>\n  \u60a8\u4f7f\u7528\u7684\u662fpip\u7248\u672c9.0.3\uff0c\u4f46\u662f\u7248\u672c18.0\u662f\u53ef\u7528\u7684\u3002<br \/>\n <br \/>\u60a8\u5e94\u8be5\u8003\u8651\u901a\u8fc7\u201cpython -m pip install\u2014upgrade pip\u201d\u547d\u4ee4\u8fdb\u884c\u5347\u7ea7\u3002\n<\/p><\/blockquote>\n<p>\u9519\u8bef\u4fe1\u606f\u5efa\u8bae\u5347\u7ea7 Pip\u3002\u4f46\u662f\uff0c\u5728\u6267\u884c\u5347\u7ea7\u547d\u4ee4\u201cpython -m pip install\u2014upgrade pip\u201d\u65f6\uff0c\u53c8\u4f1a\u51fa\u73b0\u4ee5\u4e0b\u9519\u8bef\uff1a<\/p>\n<blockquote><p>\n  ERROR: unknown command &#8220;install-upgrade&#8221; &#8211; maybe you meant &#8220;install&#8221;\n<\/p><\/blockquote>\n<p>\u8fd9\u79cd\u60c5\u51b5\u53ef\u80fd\u662f\u7531\u4e8e Pip \u547d\u4ee4\u4e0e Python \u7248\u672c\u4e0d\u5339\u914d\u5bfc\u81f4\u7684\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/strong><\/p>\n<ol>\n<li>\u786e\u4fdd\u4f7f\u7528\u6700\u65b0\u7248\u672c\u7684 Python\u3002<\/li>\n<li>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5347\u7ea7 Pip\uff1apython -m pip install &#8211;upgrade pip\uff08\u6ce8\u610f install \u548c &#8211;upgrade \u4e4b\u95f4\u4e0d\u8981\u6709\u7a7a\u683c\uff09\u3002<\/li>\n<li>\u5b89\u88c5 requests \u6a21\u5757\uff1apip install requests\u3002<\/li>\n<\/ol>\n<p>\u6587\u4e2d\u5173\u4e8e\u7684\u77e5\u8bc6\u4ecb\u7ecd\uff0c\u5e0c\u671b\u5bf9\u4f60\u7684\u5b66\u4e60\u6709\u6240\u5e2e\u52a9\uff01\u82e5\u662f\u53d7\u76ca\u532a\u6d45\uff0c\u90a3\u5c31\u52a8\u52a8\u9f20\u6807\u6536\u85cf\u8fd9\u7bc7\u300aPython \u5b89\u88c5 requests \u9047\u5230\u201cunknown command \\&#8221;install-upgrade\\&#8221;\\&#8221; \u9519\u8bef\u8be5\u5982\u4f55\u89e3\u51b3\uff1f\u300b\u6587\u7ae0\u5427\uff0c\u4e5f\u53ef\u5173\u6ce8\u516c\u4f17\u53f7\u4e86\u89e3\u76f8\u5173\u6280\u672f\u6587\u7ae0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python \u5b89\u88c5 reques&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-204988","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/204988","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=204988"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/204988\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=204988"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=204988"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=204988"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}