{"id":1165053,"date":"2025-01-15T15:15:36","date_gmt":"2025-01-15T07:15:36","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1165053.html"},"modified":"2025-01-15T15:15:38","modified_gmt":"2025-01-15T07:15:38","slug":"%e5%a6%82%e4%bd%95%e5%8d%b8%e8%bd%bd%e7%94%b5%e8%84%91%e4%b8%8a%e7%9a%84python","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1165053.html","title":{"rendered":"\u5982\u4f55\u5378\u8f7d\u7535\u8111\u4e0a\u7684python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25205504\/cf352439-6924-4c70-b280-84b0d22673da.webp\" alt=\"\u5982\u4f55\u5378\u8f7d\u7535\u8111\u4e0a\u7684python\" \/><\/p>\n<p><p> <strong>\u5378\u8f7d\u7535\u8111\u4e0a\u7684Python\u901a\u5e38\u5305\u62ec\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5378\u8f7d\u5de5\u5177\u3001\u624b\u52a8\u5220\u9664Python\u6587\u4ef6\u5939\u3001\u6e05\u7406\u73af\u5883\u53d8\u91cf<\/strong>\u3002\u63a8\u8350\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5378\u8f7d\u5de5\u5177\uff0c\u56e0\u4e3a\u8fd9\u662f\u6700\u5b89\u5168\u548c\u6700\u6709\u6548\u7684\u65b9\u5f0f\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u63cf\u8ff0\u5982\u4f55\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5378\u8f7d\u5de5\u5177\u6765\u5378\u8f7dPython\u3002<\/p>\n<\/p>\n<p><h3>\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5378\u8f7d\u5de5\u5177<\/h3>\n<\/p>\n<p><p>\u5927\u591a\u6570\u64cd\u4f5c\u7cfb\u7edf\u90fd\u6709\u81ea\u5e26\u7684\u8f6f\u4ef6\u5378\u8f7d\u5de5\u5177\uff0c\u4f8b\u5982Windows\u7684\u201c\u63a7\u5236\u9762\u677f\u201d\u548cMac\u7684\u201c\u5e94\u7528\u7a0b\u5e8f\u201d\u6587\u4ef6\u5939\u3002\u4f7f\u7528\u8fd9\u4e9b\u5de5\u5177\u5378\u8f7dPython\u901a\u5e38\u53ef\u4ee5\u786e\u4fdd\u6240\u6709\u76f8\u5173\u6587\u4ef6\u548c\u6ce8\u518c\u8868\u9879\u88ab\u6b63\u786e\u79fb\u9664\u3002<\/p>\n<\/p>\n<p><h4>Windows\u64cd\u4f5c\u7cfb\u7edf<\/h4>\n<\/p>\n<ol>\n<li><strong>\u6253\u5f00\u63a7\u5236\u9762\u677f<\/strong>\uff1a\u70b9\u51fb\u201c\u5f00\u59cb\u201d\u6309\u94ae\uff0c\u9009\u62e9\u201c\u63a7\u5236\u9762\u677f\u201d\u3002<\/li>\n<li><strong>\u9009\u62e9\u201c\u7a0b\u5e8f\u548c\u529f\u80fd\u201d<\/strong>\uff1a\u5728\u63a7\u5236\u9762\u677f\u4e2d\u9009\u62e9\u201c\u7a0b\u5e8f\u548c\u529f\u80fd\u201d\u6216\u201c\u5378\u8f7d\u7a0b\u5e8f\u201d\u3002<\/li>\n<li><strong>\u627e\u5230Python<\/strong>\uff1a\u5728\u7a0b\u5e8f\u5217\u8868\u4e2d\u627e\u5230\u4f60\u8981\u5378\u8f7d\u7684Python\u7248\u672c\uff08\u4f8b\u5982\uff1aPython 3.9.5\uff09\u3002<\/li>\n<li><strong>\u70b9\u51fb\u5378\u8f7d<\/strong>\uff1a\u9009\u4e2dPython\u7248\u672c\u5e76\u70b9\u51fb\u201c\u5378\u8f7d\u201d\u6309\u94ae\uff0c\u7136\u540e\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5378\u8f7d\u8fc7\u7a0b\u3002<\/li>\n<\/ol>\n<p><h4>Mac\u64cd\u4f5c\u7cfb\u7edf<\/h4>\n<\/p>\n<ol>\n<li><strong>\u6253\u5f00\u5e94\u7528\u7a0b\u5e8f\u6587\u4ef6\u5939<\/strong>\uff1a\u5728Finder\u4e2d\u6253\u5f00\u201c\u5e94\u7528\u7a0b\u5e8f\u201d\u6587\u4ef6\u5939\u3002<\/li>\n<li><strong>\u627e\u5230Python<\/strong>\uff1a\u627e\u5230Python\u5e94\u7528\u7a0b\u5e8f\u6587\u4ef6\u5939\uff08\u4f8b\u5982\uff1aPython 3.9\uff09\u3002<\/li>\n<li><strong>\u62d6\u52a8\u5230\u5e9f\u7eb8\u7bd3<\/strong>\uff1a\u5c06Python\u6587\u4ef6\u5939\u62d6\u52a8\u5230\u5e9f\u7eb8\u7bd3\uff0c\u7136\u540e\u6e05\u7a7a\u5e9f\u7eb8\u7bd3\u3002<\/li>\n<\/ol>\n<p><h3>\u624b\u52a8\u5220\u9664Python\u6587\u4ef6\u5939<\/h3>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u7cfb\u7edf\u81ea\u5e26\u7684\u5378\u8f7d\u5de5\u5177\u53ef\u80fd\u65e0\u6cd5\u5b8c\u5168\u79fb\u9664\u6240\u6709Python\u76f8\u5173\u6587\u4ef6\u3002\u8fd9\u65f6\u53ef\u4ee5\u624b\u52a8\u5220\u9664Python\u6587\u4ef6\u5939\u3002<\/p>\n<\/p>\n<p><h4>Windows\u64cd\u4f5c\u7cfb\u7edf<\/h4>\n<\/p>\n<ol>\n<li><strong>\u627e\u5230\u5b89\u88c5\u76ee\u5f55<\/strong>\uff1a\u901a\u5e38Python\u4f1a\u5b89\u88c5\u5728C:\\Users&lt;\u7528\u6237\u540d&gt;\\AppData\\Local\\Programs\\Python\u6216C:\\PythonXX\uff08XX\u662f\u7248\u672c\u53f7\uff09\u76ee\u5f55\u4e0b\u3002<\/li>\n<li><strong>\u5220\u9664\u6587\u4ef6\u5939<\/strong>\uff1a\u627e\u5230\u76f8\u5e94\u7684Python\u6587\u4ef6\u5939\u5e76\u624b\u52a8\u5220\u9664\u3002<\/li>\n<\/ol>\n<p><h4>Mac\u64cd\u4f5c\u7cfb\u7edf<\/h4>\n<\/p>\n<ol>\n<li><strong>\u627e\u5230\u5b89\u88c5\u76ee\u5f55<\/strong>\uff1aPython\u901a\u5e38\u4f1a\u5b89\u88c5\u5728\/Library\/Frameworks\/Python.framework\/Versions\/\u76ee\u5f55\u4e0b\u3002<\/li>\n<li><strong>\u5220\u9664\u6587\u4ef6\u5939<\/strong>\uff1a\u627e\u5230\u5bf9\u5e94\u7248\u672c\u7684\u6587\u4ef6\u5939\u5e76\u624b\u52a8\u5220\u9664\u3002<\/li>\n<\/ol>\n<p><h3>\u6e05\u7406\u73af\u5883\u53d8\u91cf<\/h3>\n<\/p>\n<p><p>\u5378\u8f7dPython\u540e\uff0c\u53ef\u80fd\u8fd8\u9700\u8981\u6e05\u7406\u73af\u5883\u53d8\u91cf\uff0c\u4ee5\u786e\u4fdd\u7cfb\u7edf\u4e2d\u6ca1\u6709\u6b8b\u7559\u7684\u8def\u5f84\u914d\u7f6e\u3002<\/p>\n<\/p>\n<p><h4>Windows\u64cd\u4f5c\u7cfb\u7edf<\/h4>\n<\/p>\n<ol>\n<li><strong>\u6253\u5f00\u7cfb\u7edf\u5c5e\u6027<\/strong>\uff1a\u53f3\u952e\u70b9\u51fb\u201c\u6b64\u7535\u8111\u201d\uff0c\u9009\u62e9\u201c\u5c5e\u6027\u201d\u3002<\/li>\n<li><strong>\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e<\/strong>\uff1a\u70b9\u51fb\u5de6\u4fa7\u7684\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\u3002<\/li>\n<li><strong>\u73af\u5883\u53d8\u91cf<\/strong>\uff1a\u5728\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\u7a97\u53e3\u4e2d\u70b9\u51fb\u201c\u73af\u5883\u53d8\u91cf\u201d\u6309\u94ae\u3002<\/li>\n<li><strong>\u7f16\u8f91\u8def\u5f84<\/strong>\uff1a\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u6216\u201c\u7528\u6237\u53d8\u91cf\u201d\u5217\u8868\u4e2d\u627e\u5230\u201cPath\u201d\uff0c\u5e76\u70b9\u51fb\u201c\u7f16\u8f91\u201d\u3002<\/li>\n<li><strong>\u5220\u9664Python\u8def\u5f84<\/strong>\uff1a\u5728\u7f16\u8f91\u7a97\u53e3\u4e2d\u627e\u5230Python\u7684\u5b89\u88c5\u8def\u5f84\uff0c\u5e76\u5220\u9664\u76f8\u5e94\u7684\u6761\u76ee\u3002<\/li>\n<\/ol>\n<p><h4>Mac\u64cd\u4f5c\u7cfb\u7edf<\/h4>\n<\/p>\n<ol>\n<li><strong>\u6253\u5f00\u7ec8\u7aef<\/strong>\uff1a\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\u6253\u5f00\u201c\u7ec8\u7aef\u201d\u3002<\/li>\n<li><strong>\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6<\/strong>\uff1a\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u6253\u5f00<del>\/.bash_profile\u3001<\/del>\/.zshrc\u6216~\/.bashrc\u6587\u4ef6\u3002<\/li>\n<li><strong>\u5220\u9664Python\u8def\u5f84<\/strong>\uff1a\u627e\u5230\u5305\u542bPython\u8def\u5f84\u7684\u884c\u5e76\u5220\u9664\uff0c\u7136\u540e\u4fdd\u5b58\u6587\u4ef6\u3002<\/li>\n<li><strong>\u5237\u65b0\u7ec8\u7aef<\/strong>\uff1a\u4f7f\u7528source ~\/.bash_profile\u3001source ~\/.zshrc\u6216source ~\/.bashrc\u547d\u4ee4\u5237\u65b0\u7ec8\u7aef\u914d\u7f6e\u3002<\/li>\n<\/ol>\n<p><h3>\u6e05\u7406\u6b8b\u7559\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u6709\u4e9bPython\u5de5\u5177\u548c\u5305\u53ef\u80fd\u4f1a\u5728\u5378\u8f7d\u540e\u7559\u4e0b\u6b8b\u7559\u6587\u4ef6\uff0c\u5c24\u5176\u662f\u5728\u4f60\u4f7f\u7528\u8fc7pip\u5b89\u88c5\u4e00\u4e9b\u7b2c\u4e09\u65b9\u5305\u7684\u60c5\u51b5\u4e0b\u3002<\/p>\n<\/p>\n<p><h4>Windows\u64cd\u4f5c\u7cfb\u7edf<\/h4>\n<\/p>\n<ol>\n<li><strong>\u67e5\u627e\u6b8b\u7559\u6587\u4ef6\u5939<\/strong>\uff1a\u68c0\u67e5\u4ee5\u4e0b\u8def\u5f84\uff0c\u770b\u662f\u5426\u6709\u6b8b\u7559\u7684Python\u6587\u4ef6\u5939\uff1a\n<ul>\n<li>C:\\Users&lt;\u7528\u6237\u540d&gt;\\AppData\\Local\\Temp<\/li>\n<li>C:\\Users&lt;\u7528\u6237\u540d&gt;\\AppData\\Roaming<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u5220\u9664\u6b8b\u7559\u6587\u4ef6<\/strong>\uff1a\u627e\u5230\u4e0ePython\u76f8\u5173\u7684\u6587\u4ef6\u5939\u5e76\u5220\u9664\u3002<\/li>\n<\/ol>\n<p><h4>Mac\u64cd\u4f5c\u7cfb\u7edf<\/h4>\n<\/p>\n<ol>\n<li><strong>\u67e5\u627e\u6b8b\u7559\u6587\u4ef6\u5939<\/strong>\uff1a\u68c0\u67e5\u4ee5\u4e0b\u8def\u5f84\uff0c\u770b\u662f\u5426\u6709\u6b8b\u7559\u7684Python\u6587\u4ef6\u5939\uff1a\n<ul>\n<li>~\/Library\/Caches<\/li>\n<li>~\/Library\/Application Support<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u5220\u9664\u6b8b\u7559\u6587\u4ef6<\/strong>\uff1a\u627e\u5230\u4e0ePython\u76f8\u5173\u7684\u6587\u4ef6\u5939\u5e76\u5220\u9664\u3002<\/li>\n<\/ol>\n<p><h3>\u6e05\u7406\u5305\u7ba1\u7406\u5de5\u5177<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u4f7f\u7528\u8fc7pipenv\u3001virtualenv\u6216\u5176\u4ed6Python\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u53ef\u80fd\u9700\u8981\u624b\u52a8\u5220\u9664\u8fd9\u4e9b\u5de5\u5177\u7684\u6b8b\u7559\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h4>Windows\u64cd\u4f5c\u7cfb\u7edf<\/h4>\n<\/p>\n<ol>\n<li><strong>\u627e\u5230\u865a\u62df\u73af\u5883\u76ee\u5f55<\/strong>\uff1a\u901a\u5e38\u8fd9\u4e9b\u5de5\u5177\u4f1a\u5728\u9879\u76ee\u76ee\u5f55\u4e0b\u521b\u5efa\u865a\u62df\u73af\u5883\u6587\u4ef6\u5939\uff08\u4f8b\u5982\uff1a.venv\u3001venv\uff09\u3002<\/li>\n<li><strong>\u5220\u9664\u865a\u62df\u73af\u5883<\/strong>\uff1a\u624b\u52a8\u5220\u9664\u8fd9\u4e9b\u865a\u62df\u73af\u5883\u6587\u4ef6\u5939\u3002<\/li>\n<\/ol>\n<p><h4>Mac\u64cd\u4f5c\u7cfb\u7edf<\/h4>\n<\/p>\n<ol>\n<li><strong>\u627e\u5230\u865a\u62df\u73af\u5883\u76ee\u5f55<\/strong>\uff1a\u540c\u6837\uff0c\u8fd9\u4e9b\u5de5\u5177\u4f1a\u5728\u9879\u76ee\u76ee\u5f55\u4e0b\u521b\u5efa\u865a\u62df\u73af\u5883\u6587\u4ef6\u5939\u3002<\/li>\n<li><strong>\u5220\u9664\u865a\u62df\u73af\u5883<\/strong>\uff1a\u624b\u52a8\u5220\u9664\u8fd9\u4e9b\u865a\u62df\u73af\u5883\u6587\u4ef6\u5939\u3002<\/li>\n<\/ol>\n<p><h3>\u5378\u8f7dPython\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u4f7f\u7528\u4e86Python\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08\u5982PyCharm\u3001Anaconda\uff09\uff0c\u5728\u5378\u8f7dPython\u540e\uff0c\u53ef\u80fd\u8fd8\u9700\u8981\u5378\u8f7d\u8fd9\u4e9bIDE\u3002<\/p>\n<\/p>\n<p><h4>Windows\u64cd\u4f5c\u7cfb\u7edf<\/h4>\n<\/p>\n<ol>\n<li><strong>\u6253\u5f00\u63a7\u5236\u9762\u677f<\/strong>\uff1a\u70b9\u51fb\u201c\u5f00\u59cb\u201d\u6309\u94ae\uff0c\u9009\u62e9\u201c\u63a7\u5236\u9762\u677f\u201d\u3002<\/li>\n<li><strong>\u9009\u62e9\u201c\u7a0b\u5e8f\u548c\u529f\u80fd\u201d<\/strong>\uff1a\u5728\u63a7\u5236\u9762\u677f\u4e2d\u9009\u62e9\u201c\u7a0b\u5e8f\u548c\u529f\u80fd\u201d\u6216\u201c\u5378\u8f7d\u7a0b\u5e8f\u201d\u3002<\/li>\n<li><strong>\u627e\u5230IDE<\/strong>\uff1a\u5728\u7a0b\u5e8f\u5217\u8868\u4e2d\u627e\u5230\u76f8\u5e94\u7684IDE\uff08\u4f8b\u5982\uff1aPyCharm\u3001Anaconda\uff09\u3002<\/li>\n<li><strong>\u70b9\u51fb\u5378\u8f7d<\/strong>\uff1a\u9009\u4e2dIDE\u5e76\u70b9\u51fb\u201c\u5378\u8f7d\u201d\u6309\u94ae\uff0c\u7136\u540e\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5378\u8f7d\u8fc7\u7a0b\u3002<\/li>\n<\/ol>\n<p><h4>Mac\u64cd\u4f5c\u7cfb\u7edf<\/h4>\n<\/p>\n<ol>\n<li><strong>\u6253\u5f00\u5e94\u7528\u7a0b\u5e8f\u6587\u4ef6\u5939<\/strong>\uff1a\u5728Finder\u4e2d\u6253\u5f00\u201c\u5e94\u7528\u7a0b\u5e8f\u201d\u6587\u4ef6\u5939\u3002<\/li>\n<li><strong>\u627e\u5230IDE<\/strong>\uff1a\u627e\u5230\u76f8\u5e94\u7684IDE\u5e94\u7528\u7a0b\u5e8f\u6587\u4ef6\u5939\u3002<\/li>\n<li><strong>\u62d6\u52a8\u5230\u5e9f\u7eb8\u7bd3<\/strong>\uff1a\u5c06IDE\u6587\u4ef6\u5939\u62d6\u52a8\u5230\u5e9f\u7eb8\u7bd3\uff0c\u7136\u540e\u6e05\u7a7a\u5e9f\u7eb8\u7bd3\u3002<\/li>\n<\/ol>\n<p><h3>\u68c0\u67e5\u7cfb\u7edf\u65e5\u5fd7\u548c\u6ce8\u518c\u8868<\/h3>\n<\/p>\n<p><p>\u6700\u540e\uff0c\u53ef\u4ee5\u68c0\u67e5\u7cfb\u7edf\u65e5\u5fd7\u548c\u6ce8\u518c\u8868\uff0c\u786e\u4fdd\u6ca1\u6709\u6b8b\u7559\u7684Python\u76f8\u5173\u6761\u76ee\u3002<\/p>\n<\/p>\n<p><h4>Windows\u64cd\u4f5c\u7cfb\u7edf<\/h4>\n<\/p>\n<ol>\n<li><strong>\u6253\u5f00\u6ce8\u518c\u8868\u7f16\u8f91\u5668<\/strong>\uff1a\u6309Win+R\u952e\uff0c\u8f93\u5165\u201cregedit\u201d\uff0c\u6309\u56de\u8f66\u3002<\/li>\n<li><strong>\u67e5\u627ePython\u76f8\u5173\u6761\u76ee<\/strong>\uff1a\u5728\u6ce8\u518c\u8868\u4e2d\u67e5\u627e\u4e0ePython\u76f8\u5173\u7684\u6761\u76ee\uff0c\u5e76\u624b\u52a8\u5220\u9664\u3002<\/li>\n<\/ol>\n<p><h4>Mac\u64cd\u4f5c\u7cfb\u7edf<\/h4>\n<\/p>\n<ol>\n<li><strong>\u68c0\u67e5\u7cfb\u7edf\u65e5\u5fd7<\/strong>\uff1a\u4f7f\u7528Console\u5e94\u7528\u7a0b\u5e8f\u68c0\u67e5\u7cfb\u7edf\u65e5\u5fd7\uff0c\u627e\u5230\u4e0ePython\u76f8\u5173\u7684\u6761\u76ee\u3002<\/li>\n<li><strong>\u624b\u52a8\u5220\u9664\u6761\u76ee<\/strong>\uff1a\u5728\u7cfb\u7edf\u65e5\u5fd7\u4e2d\u627e\u5230\u4e0ePython\u76f8\u5173\u7684\u6761\u76ee\uff0c\u5e76\u624b\u52a8\u5220\u9664\u3002<\/li>\n<\/ol>\n<p><h3>\u91cd\u65b0\u5b89\u88c5Python<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u53ea\u662f\u60f3\u91cd\u88c5Python\uff0c\u53ef\u4ee5\u5728\u5378\u8f7d\u540e\u91cd\u65b0\u4ecePython\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.python.org\/downloads\/%EF%BC%89%E4%B8%8B%E8%BD%BD%E5%B9%B6%E5%AE%89%E8%A3%85%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%AC%E7%9A%84Python%E3%80%82%E5%AE%89%E8%A3%85%E6%97%B6%E5%8F%AF%E4%BB%A5%E9%80%89%E6%8B%A9%E2%80%9C%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AE%89%E8%A3%85%E2%80%9D%EF%BC%8C%E7%A1%AE%E4%BF%9D%E8%B7%AF%E5%BE%84%E5%92%8C%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E9%83%BD%E8%AE%BE%E7%BD%AE%E6%AD%A3%E7%A1%AE%E3%80%82\">https:\/\/www.python.org\/downloads\/\uff09\u4e0b\u8f7d\u5e76\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684Python\u3002\u5b89\u88c5\u65f6\u53ef\u4ee5\u9009\u62e9\u201c\u81ea\u5b9a\u4e49\u5b89\u88c5\u201d\uff0c\u786e\u4fdd\u8def\u5f84\u548c\u914d\u7f6e\u6587\u4ef6\u90fd\u8bbe\u7f6e\u6b63\u786e\u3002<\/a><\/p>\n<\/p>\n<p><h4>\u5b89\u88c5\u524d\u7684\u51c6\u5907<\/h4>\n<\/p>\n<ol>\n<li><strong>\u5907\u4efd\u91cd\u8981\u6570\u636e<\/strong>\uff1a\u5728\u5378\u8f7d\u548c\u91cd\u65b0\u5b89\u88c5Python\u4e4b\u524d\uff0c\u786e\u4fdd\u5907\u4efd\u6240\u6709\u91cd\u8981\u7684Python\u9879\u76ee\u548c\u6570\u636e\u3002<\/li>\n<li><strong>\u4e0b\u8f7d\u65b0\u7248\u672c<\/strong>\uff1a\u4ecePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u7684\u5b89\u88c5\u5305\u3002<\/li>\n<\/ol>\n<p><h4>\u5b89\u88c5\u8fc7\u7a0b<\/h4>\n<\/p>\n<ol>\n<li><strong>\u8fd0\u884c\u5b89\u88c5\u5305<\/strong>\uff1a\u53cc\u51fb\u4e0b\u8f7d\u7684\u5b89\u88c5\u5305\uff0c\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u3002<\/li>\n<li><strong>\u9009\u62e9\u5b89\u88c5\u9009\u9879<\/strong>\uff1a\u9009\u62e9\u201c\u81ea\u5b9a\u4e49\u5b89\u88c5\u201d\u9009\u9879\uff0c\u53ef\u4ee5\u66f4\u6539\u5b89\u88c5\u8def\u5f84\u548c\u5176\u4ed6\u914d\u7f6e\u3002<\/li>\n<li><strong>\u5b8c\u6210\u5b89\u88c5<\/strong>\uff1a\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5b89\u88c5\u8fc7\u7a0b\u3002<\/li>\n<\/ol>\n<p><h3>\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5378\u8f7dPython\u5305\u62ec\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5378\u8f7d\u5de5\u5177\u3001\u624b\u52a8\u5220\u9664Python\u6587\u4ef6\u5939\u3001\u6e05\u7406\u73af\u5883\u53d8\u91cf\u3001\u6e05\u7406\u6b8b\u7559\u6587\u4ef6\u3001\u5378\u8f7dPython\u96c6\u6210\u5f00\u53d1\u73af\u5883\u4ee5\u53ca\u68c0\u67e5\u7cfb\u7edf\u65e5\u5fd7\u548c\u6ce8\u518c\u8868\u3002<strong>\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5378\u8f7d\u5de5\u5177\u662f\u6700\u5b89\u5168\u548c\u6700\u6709\u6548\u7684\u65b9\u5f0f<\/strong>\uff0c\u4f46\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u53ef\u80fd\u9700\u8981\u624b\u52a8\u5220\u9664\u6587\u4ef6\u548c\u6e05\u7406\u914d\u7f6e\u3002\u65e0\u8bba\u662f\u5378\u8f7d\u8fd8\u662f\u91cd\u88c5\uff0c\u90fd\u9700\u8981\u8c28\u614e\u64cd\u4f5c\uff0c\u786e\u4fdd\u6240\u6709\u76f8\u5173\u6570\u636e\u548c\u914d\u7f6e\u5f97\u5230\u59a5\u5584\u5904\u7406\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u786e\u8ba4\u6211\u7684\u7535\u8111\u4e0a\u662f\u5426\u5b89\u88c5\u4e86Python\uff1f<\/strong><br \/>\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\u4e2d\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\u6765\u68c0\u67e5Python\u662f\u5426\u5df2\u5b89\u88c5\u3002\u5982\u679c\u663e\u793a\u4e86\u7248\u672c\u53f7\uff0c\u8bf4\u660ePython\u5df2\u7ecf\u5b89\u88c5\u5728\u60a8\u7684\u7535\u8111\u4e0a\u3002\u5982\u679c\u7cfb\u7edf\u63d0\u793a\u627e\u4e0d\u5230\u547d\u4ee4\uff0c\u53ef\u80fdPython\u5e76\u672a\u5b89\u88c5\u3002<\/p>\n<p><strong>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u5982\u4f55\u5378\u8f7dPython\uff1f<\/strong><br \/>\u5728Windows\u4e2d\uff0c\u6253\u5f00\u201c\u63a7\u5236\u9762\u677f\u201d\uff0c\u9009\u62e9\u201c\u7a0b\u5e8f\u548c\u529f\u80fd\u201d\u3002\u5728\u5217\u8868\u4e2d\u627e\u5230Python\u7248\u672c\uff0c\u53f3\u952e\u70b9\u51fb\u5e76\u9009\u62e9\u201c\u5378\u8f7d\u201d\u3002\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5378\u8f7d\u8fc7\u7a0b\u3002\u786e\u4fdd\u540c\u65f6\u5220\u9664\u4e0ePython\u76f8\u5173\u7684\u73af\u5883\u53d8\u91cf\uff0c\u4ee5\u907f\u514d\u6f5c\u5728\u7684\u51b2\u7a81\u3002<\/p>\n<p><strong>\u5728Mac\u7cfb\u7edf\u4e2d\uff0c\u5982\u4f55\u5b89\u5168\u5730\u5378\u8f7dPython\uff1f<\/strong><br \/>\u5728Mac\u4e0a\uff0c\u6253\u5f00\u7ec8\u7aef\u5e76\u8f93\u5165<code>brew uninstall python<\/code>\uff08\u5982\u679c\u662f\u901a\u8fc7Homebrew\u5b89\u88c5\u7684\uff09\u6216\u624b\u52a8\u5220\u9664Python\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u901a\u5e38\uff0cPython\u4f1a\u5b89\u88c5\u5728<code>\/Library\/Frameworks\/Python.framework<\/code>\u548c<code>\/Applications\/Python X.X<\/code>\uff08X.X\u4e3a\u7248\u672c\u53f7\uff09\u4e0b\u3002\u8bf7\u786e\u4fdd\u5728\u5220\u9664\u8fd9\u4e9b\u6587\u4ef6\u4e4b\u524d\u5907\u4efd\u4efb\u4f55\u91cd\u8981\u7684\u9879\u76ee\u6216\u5e93\u3002<\/p>\n<p><strong>\u5378\u8f7dPython\u540e\uff0c\u5982\u4f55\u5904\u7406\u4f9d\u8d56\u7684\u5e93\u548c\u9879\u76ee\uff1f<\/strong><br \/>\u5728\u5378\u8f7dPython\u4e4b\u524d\uff0c\u5efa\u8bae\u5148\u8bb0\u5f55\u4e0b\u6240\u6709\u5df2\u5b89\u88c5\u7684\u5e93\u548c\u9879\u76ee\uff0c\u4ee5\u4fbf\u5728\u91cd\u65b0\u5b89\u88c5\u6216\u5207\u6362\u5230\u5176\u4ed6\u7248\u672c\u65f6\u4f7f\u7528\u3002\u53ef\u4ee5\u901a\u8fc7<code>pip freeze &gt; requirements.txt<\/code>\u547d\u4ee4\u5bfc\u51fa\u5f53\u524d\u73af\u5883\u4e2d\u7684\u6240\u6709\u5305\u3002\u5728\u91cd\u65b0\u5b89\u88c5Python\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528<code>pip install -r requirements.txt<\/code>\u547d\u4ee4\u5feb\u901f\u6062\u590d\u8fd9\u4e9b\u5e93\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5378\u8f7d\u7535\u8111\u4e0a\u7684Python\u901a\u5e38\u5305\u62ec\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5378\u8f7d\u5de5\u5177\u3001\u624b\u52a8\u5220\u9664Python\u6587\u4ef6\u5939\u3001\u6e05\u7406\u73af\u5883\u53d8\u91cf\u3002\u63a8\u8350\u4f7f\u7528\u7cfb\u7edf [&hellip;]","protected":false},"author":3,"featured_media":1165060,"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\/1165053"}],"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=1165053"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1165053\/revisions"}],"predecessor-version":[{"id":1165061,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1165053\/revisions\/1165061"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1165060"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1165053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1165053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1165053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}