{"id":1182331,"date":"2025-01-15T19:01:58","date_gmt":"2025-01-15T11:01:58","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1182331.html"},"modified":"2025-01-15T19:02:13","modified_gmt":"2025-01-15T11:02:13","slug":"%e5%a6%82%e4%bd%95%e5%8d%b8%e8%bd%bd%e7%94%b5%e8%84%91%e4%b8%ad%e7%9a%84python","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1182331.html","title":{"rendered":"\u5982\u4f55\u5378\u8f7d\u7535\u8111\u4e2d\u7684python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25130352\/09850a9e-2114-4917-8a71-1a753dea719f.webp\" alt=\"\u5982\u4f55\u5378\u8f7d\u7535\u8111\u4e2d\u7684python\" \/><\/p>\n<p><p> <strong>\u5982\u4f55\u5378\u8f7d\u7535\u8111\u4e2d\u7684Python\uff1a\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5378\u8f7d\u529f\u80fd\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u3001\u624b\u52a8\u5220\u9664Python\u76f8\u5173\u6587\u4ef6\u548c\u6ce8\u518c\u8868\u4fe1\u606f<\/strong><\/p>\n<\/p>\n<p><p>\u5378\u8f7d\u7535\u8111\u4e2d\u7684Python\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u5b9e\u73b0\uff0c\u5305\u62ec<strong>\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5378\u8f7d\u529f\u80fd\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u3001\u624b\u52a8\u5220\u9664Python\u76f8\u5173\u6587\u4ef6\u548c\u6ce8\u518c\u8868\u4fe1\u606f<\/strong>\u3002\u5176\u4e2d\uff0c<strong>\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5378\u8f7d\u529f\u80fd<\/strong>\u662f\u6700\u4fbf\u6377\u7684\u65b9\u6cd5\u3002\u4f60\u53ea\u9700\u6253\u5f00\u63a7\u5236\u9762\u677f\uff0c\u9009\u62e9\u201c\u7a0b\u5e8f\u548c\u529f\u80fd\u201d\uff0c\u627e\u5230Python\uff0c\u70b9\u51fb\u201c\u5378\u8f7d\u201d\u5373\u53ef\u3002\u4f46\u662f\uff0c\u6709\u65f6\u7cfb\u7edf\u81ea\u5e26\u7684\u5378\u8f7d\u529f\u80fd\u53ef\u80fd\u65e0\u6cd5\u5b8c\u5168\u79fb\u9664\u6240\u6709Python\u6587\u4ef6\u548c\u914d\u7f6e\uff0c\u8fd9\u65f6\u9700\u8981\u7ed3\u5408\u4f7f\u7528\u5176\u4ed6\u65b9\u6cd5\u6765\u786e\u4fdd\u5b8c\u5168\u5378\u8f7d\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5378\u8f7d\u529f\u80fd<\/h2>\n<\/p>\n<p><h3>\u6253\u5f00\u63a7\u5236\u9762\u677f<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6253\u5f00\u63a7\u5236\u9762\u677f\u3002\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662fWindows\u7cfb\u7edf\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u5f0f\u6253\u5f00\u63a7\u5236\u9762\u677f\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728\u684c\u9762\u4e0a\u627e\u5230\u201c\u6b64\u7535\u8111\u201d\u6216\u201c\u6211\u7684\u7535\u8111\u201d\u56fe\u6807\uff0c\u53f3\u952e\u70b9\u51fb\u5e76\u9009\u62e9\u201c\u5c5e\u6027\u201d\uff0c\u7136\u540e\u5728\u5de6\u4fa7\u83dc\u5355\u4e2d\u627e\u5230\u201c\u63a7\u5236\u9762\u677f\u4e3b\u9875\u201d\u3002<\/li>\n<li>\u6309\u4e0bWin + R\u952e\uff0c\u8f93\u5165\u201ccontrol\u201d\u5e76\u56de\u8f66\u3002<\/li>\n<li>\u5728\u4efb\u52a1\u680f\u641c\u7d22\u6846\u4e2d\u8f93\u5165\u201c\u63a7\u5236\u9762\u677f\u201d\u5e76\u56de\u8f66\u3002<\/li>\n<\/ul>\n<p><h3>\u627e\u5230\u201c\u7a0b\u5e8f\u548c\u529f\u80fd\u201d<\/h3>\n<\/p>\n<p><p>\u5728\u63a7\u5236\u9762\u677f\u4e2d\uff0c\u627e\u5230\u5e76\u70b9\u51fb\u201c\u7a0b\u5e8f\u548c\u529f\u80fd\u201d\u6216\u8005\u201c\u5378\u8f7d\u7a0b\u5e8f\u201d\u3002\u8fd9\u5c06\u6253\u5f00\u4e00\u4e2a\u65b0\u7a97\u53e3\uff0c\u5217\u51fa\u4f60\u7535\u8111\u4e0a\u5b89\u88c5\u7684\u6240\u6709\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<p><h3>\u627e\u5230Python\u5e76\u5378\u8f7d<\/h3>\n<\/p>\n<p><p>\u5728\u201c\u7a0b\u5e8f\u548c\u529f\u80fd\u201d\u7a97\u53e3\u4e2d\uff0c\u627e\u5230Python\u3002\u901a\u5e38\uff0cPython\u4f1a\u5217\u5728\u201cP\u201d\u5f00\u5934\u7684\u90e8\u5206\u3002\u9009\u4e2dPython\u540e\uff0c\u70b9\u51fb\u201c\u5378\u8f7d\u201d\u6309\u94ae\u3002\u7cfb\u7edf\u5c06\u4f1a\u5f39\u51fa\u4e00\u4e2a\u5bf9\u8bdd\u6846\uff0c\u8be2\u95ee\u4f60\u662f\u5426\u786e\u5b9a\u8981\u5378\u8f7dPython\uff0c\u70b9\u51fb\u201c\u662f\u201d\u5373\u53ef\u5f00\u59cb\u5378\u8f7d\u8fc7\u7a0b\u3002<\/p>\n<\/p>\n<p><h2>\u4e8c\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177<\/h2>\n<\/p>\n<p><h3>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26<\/h3>\n<\/p>\n<p><p>\u4f60\u53ef\u4ee5\u901a\u8fc7\u51e0\u79cd\u65b9\u5f0f\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6309\u4e0bWin + R\u952e\uff0c\u8f93\u5165\u201ccmd\u201d\u5e76\u56de\u8f66\u3002<\/li>\n<li>\u5728\u4efb\u52a1\u680f\u641c\u7d22\u6846\u4e2d\u8f93\u5165\u201ccmd\u201d\u6216\u201c\u547d\u4ee4\u63d0\u793a\u7b26\u201d\u5e76\u56de\u8f66\u3002<\/li>\n<\/ul>\n<p><h3>\u4f7f\u7528pip\u5378\u8f7dPython\u5305<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u60f3\u5378\u8f7d\u901a\u8fc7pip\u5b89\u88c5\u7684Python\u5305\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip uninstall package_name<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5c06\u201cpackage_name\u201d\u66ff\u6362\u4e3a\u4f60\u60f3\u5378\u8f7d\u7684\u5305\u540d\u3002\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u4f60\u5378\u8f7d\u7684\u53ea\u662f\u7279\u5b9a\u7684Python\u5305\uff0c\u800c\u4e0d\u662f\u6574\u4e2aPython\u89e3\u91ca\u5668\u3002<\/p>\n<\/p>\n<p><h3>\u4f7f\u7528wmic\u5378\u8f7dPython<\/h3>\n<\/p>\n<p><p>\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528Windows Management Instrumentation Command-line (WMIC) \u5de5\u5177\u6765\u5378\u8f7dPython\u3002\u9996\u5148\uff0c\u5217\u51fa\u6240\u6709\u5b89\u88c5\u7684\u7a0b\u5e8f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">wmic product get name<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u627e\u5230Python\u7684\u540d\u79f0\uff0c\u7136\u540e\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5378\u8f7d\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">wmic product where &quot;name like &#39;Python%&#39;&quot; call uninstall<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u4f1a\u5378\u8f7d\u6240\u6709\u540d\u79f0\u5305\u542b\u201cPython\u201d\u7684\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<p><h2>\u4e09\u3001\u624b\u52a8\u5220\u9664Python\u76f8\u5173\u6587\u4ef6\u548c\u6ce8\u518c\u8868\u4fe1\u606f<\/h2>\n<\/p>\n<p><h3>\u5220\u9664Python\u5b89\u88c5\u76ee\u5f55<\/h3>\n<\/p>\n<p><p>\u627e\u5230Python\u7684\u5b89\u88c5\u76ee\u5f55\uff0c\u901a\u5e38\u4f4d\u4e8eC:\\PythonXX\u6216C:\\Program Files\\PythonXX\uff08XX\u4ee3\u8868\u7248\u672c\u53f7\uff09\u3002\u5220\u9664\u6574\u4e2a\u5b89\u88c5\u76ee\u5f55\u3002<\/p>\n<\/p>\n<p><h3>\u5220\u9664\u73af\u5883\u53d8\u91cf<\/h3>\n<\/p>\n<p><p>\u53f3\u952e\u70b9\u51fb\u201c\u6b64\u7535\u8111\u201d\u6216\u201c\u6211\u7684\u7535\u8111\u201d\u56fe\u6807\uff0c\u9009\u62e9\u201c\u5c5e\u6027\u201d\uff0c\u7136\u540e\u70b9\u51fb\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\u3002\u5728\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\u7a97\u53e3\u4e2d\uff0c\u70b9\u51fb\u201c\u73af\u5883\u53d8\u91cf\u201d\u3002\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u90e8\u5206\uff0c\u627e\u5230\u5e76\u7f16\u8f91\u201cPath\u201d\u53d8\u91cf\uff0c\u5220\u9664\u4e0ePython\u76f8\u5173\u7684\u8def\u5f84\u3002<\/p>\n<\/p>\n<p><h3>\u6e05\u7406\u6ce8\u518c\u8868<\/h3>\n<\/p>\n<p><p>\u6309\u4e0bWin + R\u952e\uff0c\u8f93\u5165\u201cregedit\u201d\u5e76\u56de\u8f66\uff0c\u6253\u5f00\u6ce8\u518c\u8868\u7f16\u8f91\u5668\u3002\u5bfc\u822a\u5230\u4ee5\u4e0b\u8def\u5f84\u5e76\u5220\u9664\u4e0ePython\u76f8\u5173\u7684\u952e\uff1a<\/p>\n<\/p>\n<ul>\n<li>HKEY_CURRENT_USER\\Software\\Python<\/li>\n<li>HKEY_LOCAL_MACHINE\\SOFTWARE\\Python<\/li>\n<\/ul>\n<p><p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u4fee\u6539\u6ce8\u518c\u8868\u5b58\u5728\u4e00\u5b9a\u98ce\u9669\uff0c\u5efa\u8bae\u5728\u4fee\u6539\u524d\u5907\u4efd\u6ce8\u518c\u8868\u3002<\/p>\n<\/p>\n<p><h2>\u56db\u3001\u5378\u8f7dPython\u865a\u62df\u73af\u5883<\/h2>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662fPython\u865a\u62df\u73af\u5883\uff08virtualenv\uff09\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5378\u8f7d\uff1a<\/p>\n<\/p>\n<p><h3>\u5220\u9664\u865a\u62df\u73af\u5883\u76ee\u5f55<\/h3>\n<\/p>\n<p><p>\u627e\u5230\u865a\u62df\u73af\u5883\u7684\u76ee\u5f55\uff0c\u901a\u5e38\u662f\u4f60\u521b\u5efa\u865a\u62df\u73af\u5883\u65f6\u6307\u5b9a\u7684\u4f4d\u7f6e\u3002\u5220\u9664\u6574\u4e2a\u865a\u62df\u73af\u5883\u76ee\u5f55\u5373\u53ef\u3002<\/p>\n<\/p>\n<p><h3>\u5220\u9664pip\u7f13\u5b58<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u60f3\u5f7b\u5e95\u6e05\u7406pip\u7f13\u5b58\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip cache purge<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u4f1a\u6e05\u7406\u6240\u6709\u7f13\u5b58\u7684\u5305\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h2>\u4e94\u3001\u603b\u7ed3<\/h2>\n<\/p>\n<p><p>\u5378\u8f7d\u7535\u8111\u4e2d\u7684Python\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u5b9e\u73b0\uff0c\u5305\u62ec<strong>\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5378\u8f7d\u529f\u80fd\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u3001\u624b\u52a8\u5220\u9664Python\u76f8\u5173\u6587\u4ef6\u548c\u6ce8\u518c\u8868\u4fe1\u606f<\/strong>\u3002\u6700\u4fbf\u6377\u7684\u65b9\u6cd5\u662f<strong>\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5378\u8f7d\u529f\u80fd<\/strong>\uff0c\u4f46\u6709\u65f6\u53ef\u80fd\u9700\u8981\u7ed3\u5408\u4f7f\u7528\u5176\u4ed6\u65b9\u6cd5\u6765\u786e\u4fdd\u5b8c\u5168\u5378\u8f7d\u3002\u65e0\u8bba\u4f7f\u7528\u54ea\u79cd\u65b9\u6cd5\uff0c\u90fd\u5efa\u8bae\u5728\u64cd\u4f5c\u524d\u5907\u4efd\u91cd\u8981\u6570\u636e\uff0c\u786e\u4fdd\u7cfb\u7edf\u7a33\u5b9a\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5224\u65ad\u6211\u7684\u7535\u8111\u4e2d\u662f\u5426\u5b89\u88c5\u4e86Python\uff1f<\/strong><br \/>\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\u4e2d\u8f93\u5165\u201cpython &#8211;version\u201d\u6216\u201cpython3 &#8211;version\u201d\u6765\u68c0\u67e5\u662f\u5426\u5df2\u5b89\u88c5Python\u3002\u5982\u679c\u8fd4\u56de\u76f8\u5e94\u7684\u7248\u672c\u53f7\uff0c\u8bf4\u660ePython\u5df2\u5b89\u88c5\u3002\u5982\u679c\u663e\u793a\u672a\u627e\u5230\u547d\u4ee4\uff0c\u5219\u8868\u793a\u672a\u5b89\u88c5\u3002<\/p>\n<p><strong>\u5378\u8f7dPython\u540e\uff0c\u7cfb\u7edf\u4f1a\u53d7\u5230\u4ec0\u4e48\u5f71\u54cd\uff1f<\/strong><br \/>\u5378\u8f7dPython\u53ef\u80fd\u4f1a\u5f71\u54cd\u4f9d\u8d56\u4e8ePython\u7684\u5e94\u7528\u7a0b\u5e8f\u6216\u811a\u672c\u3002\u5982\u679c\u4f60\u4e4b\u524d\u4f7f\u7528Python\u5f00\u53d1\u8fc7\u9879\u76ee\u6216\u5b89\u88c5\u4e86\u4f9d\u8d56\u4e8ePython\u7684\u5de5\u5177\uff0c\u5efa\u8bae\u5728\u5378\u8f7d\u524d\u5907\u4efd\u76f8\u5173\u6570\u636e\uff0c\u5e76\u786e\u4fdd\u4e0d\u518d\u9700\u8981\u8fd9\u4e9b\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p><strong>\u5728Windows\u548cMac\u7535\u8111\u4e0a\u5378\u8f7dPython\u7684\u6b65\u9aa4\u6709\u4ec0\u4e48\u4e0d\u540c\uff1f<\/strong><br \/>\u5728Windows\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7\u201c\u63a7\u5236\u9762\u677f\u201d\u4e2d\u7684\u201c\u7a0b\u5e8f\u548c\u529f\u80fd\u201d\u627e\u5230Python\uff0c\u5e76\u9009\u62e9\u5378\u8f7d\u3002\u800c\u5728Mac\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7\u201c\u5e94\u7528\u7a0b\u5e8f\u201d\u6587\u4ef6\u5939\u627e\u5230Python\uff0c\u62d6\u52a8\u5230\u5e9f\u7eb8\u7bd3\u4e2d\uff0c\u7136\u540e\u6e05\u7406\u76f8\u5173\u7684\u7cfb\u7edf\u6587\u4ef6\u3002\u5177\u4f53\u6b65\u9aa4\u53ef\u80fd\u56e0\u7248\u672c\u800c\u5f02\uff0c\u5efa\u8bae\u67e5\u9605\u5b98\u65b9\u6587\u6863\u4ee5\u83b7\u53d6\u8be6\u7ec6\u8bf4\u660e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5982\u4f55\u5378\u8f7d\u7535\u8111\u4e2d\u7684Python\uff1a\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5378\u8f7d\u529f\u80fd\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u3001\u624b\u52a8\u5220\u9664Python\u76f8\u5173\u6587\u4ef6\u548c\u6ce8\u518c\u8868\u4fe1\u606f [&hellip;]","protected":false},"author":3,"featured_media":1182359,"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\/1182331"}],"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=1182331"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1182331\/revisions"}],"predecessor-version":[{"id":1182365,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1182331\/revisions\/1182365"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1182359"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1182331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1182331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1182331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}