{"id":931703,"date":"2024-12-26T17:42:34","date_gmt":"2024-12-26T09:42:34","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/931703.html"},"modified":"2024-12-26T17:42:36","modified_gmt":"2024-12-26T09:42:36","slug":"python%e5%ba%93%e5%a6%82%e4%bd%95%e6%9f%a5%e6%89%be","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/931703.html","title":{"rendered":"python\u5e93\u5982\u4f55\u67e5\u627e"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25065914\/b9375d79-5887-405e-854a-bcd9c254731a.webp\" alt=\"python\u5e93\u5982\u4f55\u67e5\u627e\" \/><\/p>\n<p><p> <strong>\u8981\u67e5\u627ePython\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528Python\u7684\u5b98\u65b9\u6587\u6863\u3001\u5229\u7528\u5728\u7ebf\u641c\u7d22\u5f15\u64ce\u3001\u63a2\u7d22Python\u5305\u7ba1\u7406\u5de5\u5177\uff08\u5982pip\uff09\u3001\u67e5\u9605\u5f00\u6e90\u793e\u533a\u8d44\u6e90\u3001\u4ee5\u53ca\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u7b49\u65b9\u5f0f\u3002<\/strong>\u8fd9\u4e9b\u65b9\u6cd5\u4e2d\uff0c\u4f7f\u7528Python\u5305\u7ba1\u7406\u5de5\u5177\uff08\u5982pip\uff09\u662f\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u4e4b\u4e00\uff0c\u56e0\u4e3a\u5b83\u63d0\u4f9b\u4e86\u76f4\u63a5\u5728\u547d\u4ee4\u884c\u4e2d\u67e5\u627e\u548c\u5b89\u88c5\u5e93\u7684\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><p>\u4f7f\u7528pip\u67e5\u627ePython\u5e93\u975e\u5e38\u7b80\u5355\u3002\u9996\u5148\uff0c\u786e\u4fdd\u4f60\u7684Python\u73af\u5883\u4e2d\u5df2\u7ecf\u5b89\u88c5\u4e86pip\u3002\u7136\u540e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u884c\u8f93\u5165<code>pip search package_name<\/code>\u6765\u67e5\u627e\u7279\u5b9a\u7684\u5e93\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u60f3\u67e5\u627e\u4e0e\u6570\u636e\u5206\u6790\u76f8\u5173\u7684\u5e93\uff0c\u53ef\u4ee5\u8f93\u5165<code>pip search data analysis<\/code>\u3002\u8fd9\u5c06\u8fd4\u56de\u4e0e\u6570\u636e\u5206\u6790\u76f8\u5173\u7684\u5e93\u5217\u8868\u3002\u4f7f\u7528pip\u4e0d\u4ec5\u53ef\u4ee5\u67e5\u627e\u5e93\uff0c\u8fd8\u53ef\u4ee5\u8f7b\u677e\u5730\u5b89\u88c5\u548c\u7ba1\u7406\u8fd9\u4e9b\u5e93\u3002\u6b64\u5916\uff0c\u501f\u52a9\u4e8ePython\u7684PyPI\uff08Python Package Index\uff09\uff0c\u4f60\u53ef\u4ee5\u8bbf\u95ee\u66f4\u8be6\u7ec6\u7684\u5e93\u4fe1\u606f\uff0c\u5305\u62ec\u7248\u672c\u3001\u4f9d\u8d56\u5173\u7cfb\u3001\u4ee5\u53ca\u4f7f\u7528\u8bf4\u660e\u3002<\/p>\n<\/p>\n<hr>\n<p><h3>\u4e00\u3001\u4f7f\u7528PYTHON\u5b98\u65b9\u7f51\u7ad9\u548c\u6587\u6863<\/h3>\n<\/p>\n<p><p>Python\u7684\u5b98\u65b9\u7f51\u7ad9\u548c\u6587\u6863\u662f\u5b66\u4e60\u548c\u67e5\u627e\u5e93\u7684\u9996\u8981\u8d44\u6e90\u3002Python\u7684\u5b98\u65b9\u6587\u6863\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u5e93\u53c2\u8003\u6307\u5357\uff0c\u8ba9\u7528\u6237\u80fd\u591f\u5feb\u901f\u627e\u5230\u6240\u9700\u7684\u5e93\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6d4f\u89c8\u5b98\u65b9\u6587\u6863<\/strong><\/p>\n<\/p>\n<p><p>Python\u5b98\u65b9\u6587\u6863\uff08<a href=\"https:\/\/docs.python.org%EF%BC%89%E8%AF%A6%E7%BB%86%E5%88%97%E5%87%BA%E4%BA%86%E6%A0%87%E5%87%86%E5%BA%93%E5%92%8C%E7%AC%AC%E4%B8%89%E6%96%B9%E5%BA%93%E7%9A%84%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95%E5%92%8C%E8%AF%B4%E6%98%8E%E3%80%82%E9%80%9A%E8%BF%87%E6%B5%8F%E8%A7%88%E8%BF%99%E4%BA%9B%E6%96%87%E6%A1%A3%EF%BC%8C%E4%BD%A0%E5%8F%AF%E4%BB%A5%E4%BA%86%E8%A7%A3%E5%88%B0%E6%AF%8F%E4%B8%AA%E5%BA%93%E7%9A%84%E5%8A%9F%E8%83%BD%E3%80%81%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95%E4%BB%A5%E5%8F%8A%E5%B8%B8%E8%A7%81%E7%9A%84%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF%E3%80%82%E5%AE%98%E6%96%B9%E6%96%87%E6%A1%A3%E9%80%9A%E5%B8%B8%E5%8C%85%E5%90%AB%E8%AF%A6%E7%BB%86%E7%9A%84%E4%BB%A3%E7%A0%81%E7%A4%BA%E4%BE%8B%EF%BC%8C%E6%9C%89%E5%8A%A9%E4%BA%8E%E7%90%86%E8%A7%A3%E5%BA%93%E7%9A%84%E5%AE%9E%E9%99%85%E5%BA%94%E7%94%A8%E3%80%82\">https:\/\/docs.python.org\uff09\u8be6\u7ec6\u5217\u51fa\u4e86\u6807\u51c6\u5e93\u548c\u7b2c\u4e09\u65b9\u5e93\u7684\u4f7f\u7528\u65b9\u6cd5\u548c\u8bf4\u660e\u3002\u901a\u8fc7\u6d4f\u89c8\u8fd9\u4e9b\u6587\u6863\uff0c\u4f60\u53ef\u4ee5\u4e86\u89e3\u5230\u6bcf\u4e2a\u5e93\u7684\u529f\u80fd\u3001\u4f7f\u7528\u65b9\u6cd5\u4ee5\u53ca\u5e38\u89c1\u7684\u4f7f\u7528\u573a\u666f\u3002\u5b98\u65b9\u6587\u6863\u901a\u5e38\u5305\u542b\u8be6\u7ec6\u7684\u4ee3\u7801\u793a\u4f8b\uff0c\u6709\u52a9\u4e8e\u7406\u89e3\u5e93\u7684\u5b9e\u9645\u5e94\u7528\u3002<\/a><\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528Python\u5e93\u7d22\u5f15<\/strong><\/p>\n<\/p>\n<p><p>Python\u5e93\u7d22\u5f15\uff08Python Package Index, PyPI\uff09\u662f\u4e00\u4e2a\u5305\u542b\u6570\u4e07\u4e2aPython\u5e93\u7684\u5b58\u50a8\u5e93\u3002\u901a\u8fc7\u8bbf\u95eePyPI\uff08<a href=\"https:\/\/pypi.org%EF%BC%89%EF%BC%8C%E4%BD%A0%E5%8F%AF%E4%BB%A5%E6%9F%A5%E6%89%BE%E3%80%81%E4%B8%8B%E8%BD%BD%E5%92%8C%E5%AE%89%E8%A3%85%E5%90%84%E7%A7%8DPython%E5%BA%93%E3%80%82PyPI%E6%8F%90%E4%BE%9B%E4%BA%86%E4%B8%B0%E5%AF%8C%E7%9A%84%E5%BA%93%E4%BF%A1%E6%81%AF%EF%BC%8C%E5%8C%85%E6%8B%AC%E7%89%88%E6%9C%AC%E5%8E%86%E5%8F%B2%E3%80%81%E4%BE%9D%E8%B5%96%E5%85%B3%E7%B3%BB%E3%80%81%E6%96%87%E6%A1%A3%E9%93%BE%E6%8E%A5%E7%AD%89%EF%BC%8C%E5%B8%AE%E5%8A%A9%E7%94%A8%E6%88%B7%E6%9B%B4%E5%A5%BD%E5%9C%B0%E9%80%89%E6%8B%A9%E5%92%8C%E4%BD%BF%E7%94%A8%E5%BA%93%E3%80%82\">https:\/\/pypi.org\uff09\uff0c\u4f60\u53ef\u4ee5\u67e5\u627e\u3001\u4e0b\u8f7d\u548c\u5b89\u88c5\u5404\u79cdPython\u5e93\u3002PyPI\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u5e93\u4fe1\u606f\uff0c\u5305\u62ec\u7248\u672c\u5386\u53f2\u3001\u4f9d\u8d56\u5173\u7cfb\u3001\u6587\u6863\u94fe\u63a5\u7b49\uff0c\u5e2e\u52a9\u7528\u6237\u66f4\u597d\u5730\u9009\u62e9\u548c\u4f7f\u7528\u5e93\u3002<\/a><\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e8c\u3001\u5229\u7528\u5728\u7ebf\u641c\u7d22\u5f15\u64ce<\/h3>\n<\/p>\n<p><p>\u5728\u7ebf\u641c\u7d22\u5f15\u64ce\u662f\u67e5\u627ePython\u5e93\u7684\u5feb\u6377\u65b9\u6cd5\u3002\u901a\u8fc7\u8f93\u5165\u5173\u952e\u5b57\uff0c\u4f60\u53ef\u4ee5\u5feb\u901f\u627e\u5230\u4e0e\u4e4b\u76f8\u5173\u7684\u5e93\u548c\u8d44\u6e90\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528Google\u641c\u7d22<\/strong><\/p>\n<\/p>\n<p><p>Google\u7b49\u641c\u7d22\u5f15\u64ce\u662f\u67e5\u627ePython\u5e93\u7684\u5f3a\u5927\u5de5\u5177\u3002\u901a\u8fc7\u8f93\u5165\u76f8\u5173\u7684\u5173\u952e\u5b57\uff08\u4f8b\u5982\u201cPython data analysis library\u201d\uff09\uff0c\u4f60\u53ef\u4ee5\u627e\u5230\u63a8\u8350\u7684\u5e93\u3001\u535a\u5ba2\u6587\u7ae0\u3001\u6559\u7a0b\u548c\u8bba\u575b\u5e16\u5b50\u3002\u8fd9\u4e9b\u8d44\u6e90\u901a\u5e38\u4f1a\u4ecb\u7ecd\u5e93\u7684\u529f\u80fd\u3001\u4f7f\u7528\u573a\u666f\u4ee5\u53ca\u5982\u4f55\u5b89\u88c5\u548c\u4f7f\u7528\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u67e5\u627e\u535a\u5ba2\u548c\u6587\u7ae0<\/strong><\/p>\n<\/p>\n<p><p>\u8bb8\u591a\u5f00\u53d1\u8005\u4f1a\u5728\u535a\u5ba2\u548c\u6280\u672f\u7f51\u7ad9\u4e0a\u5206\u4eab\u4ed6\u4eec\u4f7f\u7528Python\u5e93\u7684\u7ecf\u9a8c\u3002\u8fd9\u4e9b\u6587\u7ae0\u901a\u5e38\u5305\u542b\u5177\u4f53\u7684\u4ee3\u7801\u793a\u4f8b\u548c\u8be6\u7ec6\u7684\u4f7f\u7528\u6307\u5357\uff0c\u6709\u52a9\u4e8e\u7406\u89e3\u5e93\u7684\u5b9e\u9645\u5e94\u7528\u573a\u666f\u3002\u540c\u65f6\uff0c\u535a\u5ba2\u6587\u7ae0\u4e5f\u5e38\u5e38\u4f1a\u5bf9\u6bd4\u4e0d\u540c\u5e93\u7684\u4f18\u7f3a\u70b9\uff0c\u5e2e\u52a9\u7528\u6237\u505a\u51fa\u66f4\u597d\u7684\u9009\u62e9\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e09\u3001\u63a2\u7d22\u5f00\u6e90\u793e\u533a\u8d44\u6e90<\/h3>\n<\/p>\n<p><p>\u5f00\u6e90\u793e\u533a\u662fPython\u751f\u6001\u7cfb\u7edf\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\u3002\u901a\u8fc7\u53c2\u4e0e\u793e\u533a\u6d3b\u52a8\uff0c\u4f60\u53ef\u4ee5\u4e86\u89e3\u6700\u65b0\u7684\u5e93\u548c\u6280\u672f\u52a8\u6001\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u53c2\u4e0e\u5f00\u53d1\u8005\u8bba\u575b<\/strong><\/p>\n<\/p>\n<p><p>\u5f00\u53d1\u8005\u8bba\u575b\uff08\u5982Stack Overflow\u3001Reddit\u7b49\uff09\u662f\u4ea4\u6d41\u548c\u83b7\u53d6\u4fe1\u606f\u7684\u597d\u5730\u65b9\u3002\u5728\u8fd9\u4e9b\u5e73\u53f0\u4e0a\uff0c\u4f60\u53ef\u4ee5\u63d0\u51fa\u95ee\u9898\u3001\u5206\u4eab\u7ecf\u9a8c\u3001\u4ee5\u53ca\u83b7\u53d6\u5176\u4ed6\u5f00\u53d1\u8005\u7684\u5efa\u8bae\u3002\u8fd9\u4e9b\u8bba\u575b\u4e0a\u901a\u5e38\u4f1a\u6709\u5173\u4e8e\u5e93\u4f7f\u7528\u7684\u8ba8\u8bba\u548c\u63a8\u8350\uff0c\u5e2e\u52a9\u4f60\u627e\u5230\u5408\u9002\u7684\u5e93\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u52a0\u5165\u5f00\u6e90\u9879\u76ee<\/strong><\/p>\n<\/p>\n<p><p>\u53c2\u4e0e\u5f00\u6e90\u9879\u76ee\u4e0d\u4ec5\u80fd\u63d0\u5347\u4f60\u7684\u7f16\u7a0b\u6280\u80fd\uff0c\u8fd8\u80fd\u8ba9\u4f60\u63a5\u89e6\u5230\u65b0\u7684\u5e93\u548c\u5de5\u5177\u3002\u901a\u8fc7\u8d21\u732e\u4ee3\u7801\u3001\u63d0\u4ea4\u95ee\u9898\u548c\u53c2\u4e0e\u8ba8\u8bba\uff0c\u4f60\u53ef\u4ee5\u4e86\u89e3\u5e93\u7684\u6700\u65b0\u52a8\u6001\u548c\u53d1\u5c55\u65b9\u5411\u3002\u8fd9\u4e5f\u662f\u4e0e\u5176\u4ed6\u5f00\u53d1\u8005\u5efa\u7acb\u8054\u7cfb\u7684\u597d\u673a\u4f1a\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u56db\u3001\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/h3>\n<\/p>\n<p><p>\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u5de5\u5177\u652f\u6301\uff0c\u5e2e\u52a9\u5f00\u53d1\u8005\u9ad8\u6548\u5730\u67e5\u627e\u548c\u4f7f\u7528Python\u5e93\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5229\u7528IDE\u7684\u63d2\u4ef6<\/strong><\/p>\n<\/p>\n<p><p>\u8bb8\u591aIDE\uff08\u5982PyCharm\u3001VSCode\u7b49\uff09\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u63d2\u4ef6\u751f\u6001\u7cfb\u7edf\u3002\u8fd9\u4e9b\u63d2\u4ef6\u53ef\u4ee5\u5e2e\u52a9\u4f60\u67e5\u627e\u3001\u5b89\u88c5\u548c\u7ba1\u7406Python\u5e93\u3002\u4f8b\u5982\uff0cPyCharm\u7684\u5185\u7f6ePython\u5305\u7ba1\u7406\u5668\u53ef\u4ee5\u76f4\u63a5\u5728IDE\u4e2d\u641c\u7d22\u548c\u5b89\u88c5\u5e93\uff0c\u65b9\u4fbf\u5feb\u6377\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528\u81ea\u52a8\u8865\u5168\u529f\u80fd<\/strong><\/p>\n<\/p>\n<p><p>\u73b0\u4ee3IDE\u901a\u5e38\u652f\u6301\u4ee3\u7801\u81ea\u52a8\u8865\u5168\u529f\u80fd\u3002\u5f53\u4f60\u5728\u4ee3\u7801\u4e2d\u8f93\u5165\u5e93\u540d\u6216\u51fd\u6570\u540d\u65f6\uff0cIDE\u4f1a\u81ea\u52a8\u63a8\u8350\u76f8\u5173\u7684\u5e93\u548c\u65b9\u6cd5\u3002\u8fd9\u4e0d\u4ec5\u52a0\u5feb\u4e86\u7f16\u7801\u901f\u5ea6\uff0c\u4e5f\u5e2e\u52a9\u4f60\u53d1\u73b0\u65b0\u7684\u5e93\u548c\u529f\u80fd\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e94\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u67e5\u627ePython\u5e93\u7684\u65b9\u6cd5\u591a\u79cd\u591a\u6837\uff0c\u5173\u952e\u5728\u4e8e\u9009\u62e9\u9002\u5408\u81ea\u5df1\u7684\u65b9\u5f0f\u3002\u65e0\u8bba\u662f\u901a\u8fc7\u5b98\u65b9\u6587\u6863\u3001\u5728\u7ebf\u641c\u7d22\u3001\u5f00\u6e90\u793e\u533a\uff0c\u8fd8\u662f\u4f7f\u7528IDE\u5de5\u5177\uff0c\u4e86\u89e3\u548c\u4f7f\u7528\u5408\u9002\u7684Python\u5e93\u80fd\u5927\u5927\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u3002\u5e0c\u671b\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u80fd\u591f\u5e2e\u52a9\u4f60\u5728Python\u7684\u4e16\u754c\u4e2d\u66f4\u597d\u5730\u63a2\u7d22\u548c\u53d1\u73b0\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u67e5\u627ePython\u5e93\u7684\u6700\u65b0\u7248\u672c\uff1f<\/strong><br \/>\u8981\u67e5\u627ePython\u5e93\u7684\u6700\u65b0\u7248\u672c\uff0c\u53ef\u4ee5\u8bbf\u95eePython Package Index\uff08PyPI\uff09\u7f51\u7ad9\uff0c\u8f93\u5165\u5e93\u7684\u540d\u79f0\u8fdb\u884c\u641c\u7d22\u3002\u5728\u7ed3\u679c\u4e2d\uff0c\u60a8\u5c06\u770b\u5230\u5e93\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5305\u62ec\u6700\u65b0\u7684\u7248\u672c\u53f7\u548c\u53d1\u5e03\u65e5\u671f\u3002\u6b64\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u5982<code>pip<\/code>\uff0c\u901a\u8fc7\u547d\u4ee4<code>pip search \u5e93\u540d<\/code>\u6765\u67e5\u627e\u53ef\u7528\u5e93\u53ca\u5176\u7248\u672c\u3002<\/p>\n<p><strong>\u6709\u54ea\u4e9b\u65b9\u6cd5\u53ef\u4ee5\u67e5\u627ePython\u5e93\u7684\u4f9d\u8d56\u5173\u7cfb\uff1f<\/strong><br \/>\u67e5\u627ePython\u5e93\u7684\u4f9d\u8d56\u5173\u7cfb\u6709\u51e0\u79cd\u65b9\u6cd5\u3002\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u67e5\u770b\u5e93\u7684\u6587\u6863\uff0c\u901a\u5e38\u4f1a\u5728\u201c\u5b89\u88c5\u201d\u6216\u201c\u4f9d\u8d56\u201d\u90e8\u5206\u5217\u51fa\u9700\u8981\u7684\u5176\u4ed6\u5e93\u3002\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528<code>pip show \u5e93\u540d<\/code>\u547d\u4ee4\u6765\u67e5\u770b\u8be5\u5e93\u7684\u4f9d\u8d56\u4fe1\u606f\uff0c\u6216\u4f7f\u7528<code>pipdeptree<\/code>\u5de5\u5177\u6765\u751f\u6210\u6574\u4e2a\u9879\u76ee\u7684\u4f9d\u8d56\u6811\u3002<\/p>\n<p><strong>\u5982\u4f55\u901a\u8fc7\u4ee3\u7801\u67e5\u627e\u5df2\u5b89\u88c5\u7684Python\u5e93\uff1f<\/strong><br \/>\u53ef\u4ee5\u4f7f\u7528Python\u5185\u7f6e\u7684<code>pkg_resources<\/code>\u6a21\u5757\u6765\u67e5\u627e\u5df2\u5b89\u88c5\u7684\u5e93\u3002\u5728\u4ee3\u7801\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u5217\u51fa\u6240\u6709\u5df2\u5b89\u88c5\u7684\u5e93\u53ca\u5176\u7248\u672c\uff1a  <\/p>\n<pre><code class=\"language-python\">import pkg_resources\ninstalled_packages = pkg_resources.working_set\nfor package in installed_packages:\n    print(f&quot;{package.project_name}=={package.version}&quot;)\n<\/code><\/pre>\n<p>\u8fd9\u6837\u53ef\u4ee5\u65b9\u4fbf\u5730\u67e5\u770b\u60a8\u5f53\u524d\u73af\u5883\u4e2d\u6240\u6709\u7684\u5e93\u53ca\u5176\u7248\u672c\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u67e5\u627ePython\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528Python\u7684\u5b98\u65b9\u6587\u6863\u3001\u5229\u7528\u5728\u7ebf\u641c\u7d22\u5f15\u64ce\u3001\u63a2\u7d22Python\u5305\u7ba1\u7406\u5de5\u5177\uff08\u5982pi [&hellip;]","protected":false},"author":3,"featured_media":931705,"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\/931703"}],"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=931703"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/931703\/revisions"}],"predecessor-version":[{"id":931707,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/931703\/revisions\/931707"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/931705"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=931703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=931703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=931703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}