{"id":1009948,"date":"2024-12-27T11:16:25","date_gmt":"2024-12-27T03:16:25","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1009948.html"},"modified":"2024-12-27T11:16:28","modified_gmt":"2024-12-27T03:16:28","slug":"python%e4%b8%ad%e5%a6%82%e4%bd%95%e5%8d%b8%e8%bd%bdsip","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1009948.html","title":{"rendered":"python\u4e2d\u5982\u4f55\u5378\u8f7dsip"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25084655\/044eaff1-bd55-4011-8971-982bc51db867.webp\" alt=\"python\u4e2d\u5982\u4f55\u5378\u8f7dsip\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u5378\u8f7dSIP\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528pip\u547d\u4ee4\u3001\u624b\u52a8\u5220\u9664SIP\u5305\u6587\u4ef6\u3001\u4ee5\u53ca\u5229\u7528\u5305\u7ba1\u7406\u5de5\u5177\u8fdb\u884c\u5378\u8f7d\u3002<\/strong>\u5176\u4e2d\uff0c\u4f7f\u7528pip\u547d\u4ee4\u662f\u6700\u4e3a\u76f4\u63a5\u548c\u7b80\u5355\u7684\u65b9\u6cd5\uff0c\u9002\u5408\u5927\u591a\u6570\u7528\u6237\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u901a\u8fc7pip\u547d\u4ee4\u5378\u8f7dSIP\uff0c\u5e76\u63a2\u8ba8\u5176\u4ed6\u65b9\u6cd5\u7684\u4f7f\u7528\u573a\u666f\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528pip\u547d\u4ee4\u5378\u8f7dSIP<\/p>\n<\/p>\n<p><p>\u4f7f\u7528pip\u547d\u4ee4\u662f\u5378\u8f7dPython\u5305\u7684\u6807\u51c6\u65b9\u5f0f\uff0c\u56e0\u4e3apip\u662fPython\u5b98\u65b9\u63a8\u8350\u7684\u5305\u7ba1\u7406\u5de5\u5177\u3002\u4ee5\u4e0b\u662f\u901a\u8fc7pip\u547d\u4ee4\u5378\u8f7dSIP\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u786e\u4fdd\u5df2\u5b89\u88c5pip<\/strong><br \/>\u5728\u5378\u8f7dSIP\u4e4b\u524d\uff0c\u9996\u5148\u8981\u786e\u4fdd\u5df2\u5b89\u88c5pip\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u8f93\u5165<code>pip --version<\/code>\u6765\u68c0\u67e5\u3002\u5982\u679c\u672a\u5b89\u88c5\uff0c\u53ef\u4ee5\u901a\u8fc7<code>python -m ensurepip<\/code>\u6765\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5378\u8f7dSIP<\/strong><br \/>\u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5378\u8f7dSIP\uff1a<\/p>\n<\/p>\n<p><pre><code>pip uninstall sip<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7cfb\u7edf\u5c06\u63d0\u793a\u60a8\u786e\u8ba4\u5378\u8f7d\uff0c\u8f93\u5165<code>y<\/code>\u5e76\u6309\u56de\u8f66\u952e\u4ee5\u7ee7\u7eed\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u5378\u8f7d<\/strong><br \/>\u8981\u9a8c\u8bc1SIP\u662f\u5426\u5df2\u6210\u529f\u5378\u8f7d\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code>pip show sip<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u6ca1\u6709\u663e\u793a\u4efb\u4f55\u4fe1\u606f\uff0c\u5219\u8868\u793aSIP\u5df2\u88ab\u6210\u529f\u5378\u8f7d\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4f7f\u7528pip\u547d\u4ee4\u6765\u5378\u8f7dSIP\u662f\u6700\u4e3a\u5feb\u6377\u548c\u5b89\u5168\u7684\u65b9\u5f0f\uff0c\u56e0\u4e3apip\u4f1a\u81ea\u52a8\u5904\u7406\u5305\u7684\u4f9d\u8d56\u5173\u7cfb\uff0c\u5e76\u786e\u4fdd\u4e0d\u4f1a\u5f71\u54cd\u5230\u5176\u4ed6\u5305\u7684\u8fd0\u884c\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u624b\u52a8\u5220\u9664SIP\u5305\u6587\u4ef6<\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u624b\u52a8\u5220\u9664SIP\u5305\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u5f53pip\u547d\u4ee4\u65e0\u6cd5\u6b63\u5e38\u5de5\u4f5c\u6216\u8005\u60a8\u51fa\u4e8e\u7279\u6b8a\u9700\u6c42\u9700\u8981\u624b\u52a8\u7ba1\u7406Python\u73af\u5883\u65f6\uff0c\u53ef\u4ee5\u8003\u8651\u8fd9\u79cd\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b9a\u4f4dSIP\u5b89\u88c5\u76ee\u5f55<\/strong><br \/>\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u627e\u5230SIP\u7684\u5b89\u88c5\u76ee\u5f55\uff1a<\/p>\n<\/p>\n<p><pre><code>pip show sip<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8f93\u51fa\u4fe1\u606f\u4e2d\u67e5\u627e<code>Location<\/code>\u5b57\u6bb5\uff0c\u8fd9\u5c06\u544a\u8bc9\u60a8SIP\u5305\u7684\u5b89\u88c5\u8def\u5f84\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5220\u9664SIP\u6587\u4ef6<\/strong><br \/>\u4f7f\u7528\u6587\u4ef6\u7ba1\u7406\u5668\u6216\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u5bfc\u822a\u5230SIP\u7684\u5b89\u88c5\u76ee\u5f55\u5e76\u5220\u9664\u76f8\u5173\u6587\u4ef6\u5939\u3002\u901a\u5e38\uff0cSIP\u6587\u4ef6\u5939\u7684\u540d\u79f0\u662f\u7c7b\u4f3c\u4e8e<code>sip-&lt;version&gt;<\/code>\u7684\u683c\u5f0f\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u624b\u52a8\u5220\u9664SIP\u5305\u6587\u4ef6\u7684\u65b9\u6cd5\u8981\u6c42\u5bf9Python\u73af\u5883\u6709\u6df1\u5165\u7684\u7406\u89e3\uff0c\u4ee5\u907f\u514d\u8bef\u5220\u5176\u4ed6\u91cd\u8981\u7684\u6587\u4ef6\u6216\u5305\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u5229\u7528\u5305\u7ba1\u7406\u5de5\u5177<\/p>\n<\/p>\n<p><p>\u5728\u4e00\u4e9b\u9ad8\u7ea7\u7684\u5f00\u53d1\u73af\u5883\u4e2d\uff0c\u4f8b\u5982Anaconda\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5176\u81ea\u5e26\u7684\u5305\u7ba1\u7406\u5de5\u5177\u6765\u5378\u8f7dSIP\u3002Anaconda\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u6570\u636e\u79d1\u5b66\u5e73\u53f0\uff0c\u63d0\u4f9b\u4e86\u66f4\u5168\u9762\u7684\u5305\u7ba1\u7406\u529f\u80fd\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528conda\u5378\u8f7dSIP<\/strong><br \/>\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662fAnaconda\u73af\u5883\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5378\u8f7dSIP\uff1a<\/p>\n<\/p>\n<p><pre><code>conda remove sip<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8be5\u547d\u4ee4\u5c06\u5904\u7406\u4f9d\u8d56\u5173\u7cfb\uff0c\u5e76\u786e\u4fdd\u5378\u8f7d\u8fc7\u7a0b\u4e0d\u4f1a\u5f71\u54cd\u5176\u4ed6\u5305\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7ba1\u7406\u73af\u5883<\/strong><br \/>\u9664\u4e86\u5378\u8f7dSIP\u4e4b\u5916\uff0cAnaconda\u8fd8\u5141\u8bb8\u60a8\u521b\u5efa\u548c\u7ba1\u7406\u72ec\u7acb\u7684Python\u73af\u5883\u3002\u8fd9\u610f\u5473\u7740\u60a8\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u73af\u5883\u4e2d\u5b89\u88c5\u4e0d\u540c\u7248\u672c\u7684SIP\uff0c\u800c\u4e0d\u4f1a\u76f8\u4e92\u5e72\u6270\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177\u5378\u8f7dSIP\u9002\u7528\u4e8e\u90a3\u4e9b\u5728\u590d\u6742\u9879\u76ee\u4e2d\u5de5\u4f5c\u4e14\u9700\u8981\u66f4\u5f3a\u5927\u5305\u7ba1\u7406\u80fd\u529b\u7684\u7528\u6237\u3002<\/p>\n<\/p>\n<p><p>\u603b\u7ed3\u6765\u8bf4\uff0c\u5378\u8f7dSIP\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u5176\u4e2d\u4f7f\u7528pip\u547d\u4ee4\u662f\u6700\u4e3a\u5e38\u89c1\u548c\u65b9\u4fbf\u7684\u65b9\u6cd5\u3002\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u65b9\u5f0f\uff0c\u786e\u4fdd\u6e05\u695a\u7406\u89e3\u6bcf\u4e00\u6b65\u64cd\u4f5c\u7684\u5f71\u54cd\uff0c\u4ee5\u907f\u514d\u5bf9Python\u73af\u5883\u9020\u6210\u4e0d\u5fc5\u8981\u7684\u5e72\u6270\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u786e\u5b9a\u6211\u7684Python\u73af\u5883\u4e2d\u662f\u5426\u5b89\u88c5\u4e86sip\uff1f<\/strong><br \/>\u60a8\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>pip list<\/code>\u6765\u67e5\u770b\u5df2\u5b89\u88c5\u7684Python\u5305\u3002\u5982\u679csip\u5df2\u5b89\u88c5\uff0c\u60a8\u4f1a\u5728\u5217\u8868\u4e2d\u770b\u5230\u5b83\u7684\u7248\u672c\u53f7\u3002\u6b64\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528<code>pip show sip<\/code>\u547d\u4ee4\u83b7\u53d6\u66f4\u8be6\u7ec6\u7684\u4fe1\u606f\uff0c\u5305\u62ec\u5b89\u88c5\u4f4d\u7f6e\u548c\u7248\u672c\u3002<\/p>\n<p><strong>\u5378\u8f7dsip\u540e\uff0c\u6211\u7684Python\u9879\u76ee\u4f1a\u53d7\u5230\u5f71\u54cd\u5417\uff1f<\/strong><br \/>\u5378\u8f7dsip\u53ef\u80fd\u4f1a\u5f71\u54cd\u4f9d\u8d56\u4e8e\u8be5\u5e93\u7684\u9879\u76ee\u6216\u5e94\u7528\u7a0b\u5e8f\u3002\u5982\u679c\u60a8\u7684\u9879\u76ee\u4f7f\u7528\u4e86sip\u751f\u6210\u7684\u7ed1\u5b9a\u4ee3\u7801\uff0c\u5efa\u8bae\u5728\u5378\u8f7d\u4e4b\u524d\u4ed4\u7ec6\u68c0\u67e5\u9879\u76ee\u7684\u4f9d\u8d56\u5173\u7cfb\uff0c\u5e76\u786e\u4fdd\u60a8\u6709\u5176\u4ed6\u66ff\u4ee3\u65b9\u6848\u6216\u66f4\u65b0\u7684\u4ee3\u7801\u53ef\u4ee5\u4f7f\u7528\u3002<\/p>\n<p><strong>\u5982\u679c\u6211\u5378\u8f7dsip\u540e\u9700\u8981\u91cd\u65b0\u5b89\u88c5\uff0c\u5982\u4f55\u64cd\u4f5c\uff1f<\/strong><br \/>\u5982\u679c\u60a8\u9700\u8981\u91cd\u65b0\u5b89\u88c5sip\uff0c\u53ef\u4ee5\u4f7f\u7528<code>pip install sip<\/code>\u547d\u4ee4\u3002\u5982\u679c\u60a8\u9700\u8981\u7279\u5b9a\u7248\u672c\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u4e2d\u6307\u5b9a\u7248\u672c\u53f7\uff0c\u4f8b\u5982<code>pip install sip==6.5.0<\/code>\u3002\u786e\u4fdd\u5728\u5b89\u88c5\u4e4b\u524d\u68c0\u67e5sip\u7684\u517c\u5bb9\u6027\u4e0e\u60a8\u7684Python\u7248\u672c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u5378\u8f7dSIP\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528pip\u547d\u4ee4\u3001\u624b\u52a8\u5220\u9664SIP\u5305\u6587\u4ef6\u3001\u4ee5\u53ca\u5229\u7528\u5305\u7ba1\u7406\u5de5\u5177\u8fdb\u884c\u5378\u8f7d\u3002\u5176\u4e2d\uff0c\u4f7f\u7528 [&hellip;]","protected":false},"author":3,"featured_media":1009953,"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\/1009948"}],"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=1009948"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1009948\/revisions"}],"predecessor-version":[{"id":1009956,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1009948\/revisions\/1009956"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1009953"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1009948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1009948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1009948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}