{"id":991107,"date":"2024-12-27T08:25:50","date_gmt":"2024-12-27T00:25:50","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/991107.html"},"modified":"2024-12-27T08:25:53","modified_gmt":"2024-12-27T00:25:53","slug":"%e5%a6%82%e4%bd%95%e6%89%a7%e8%a1%8cpython%e6%96%87%e4%bb%b6%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/991107.html","title":{"rendered":"\u5982\u4f55\u6267\u884cpython\u6587\u4ef6\u811a\u672c"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25065534\/9d09663e-6b85-4c3c-b8c2-6a7ab7c70dc7.webp\" alt=\"\u5982\u4f55\u6267\u884cpython\u6587\u4ef6\u811a\u672c\" \/><\/p>\n<p><p> <strong>\u6267\u884cPython\u6587\u4ef6\u811a\u672c\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528\u547d\u4ee4\u884c\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u4ee5\u53ca\u8c03\u5ea6\u7a0b\u5e8f\u7b49\u3002\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u901a\u8fc7\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u6267\u884cPython\u811a\u672c\u3001\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u5982PyCharm\u3001VSCode\u3001\u6216Jupyter Notebook\u3001\u901a\u8fc7\u8c03\u5ea6\u7a0b\u5e8f\u5982CronJob\u5728\u7279\u5b9a\u65f6\u95f4\u81ea\u52a8\u6267\u884c\u3002<\/strong> \u4e0b\u9762\u5c06\u5bf9\u4f7f\u7528\u547d\u4ee4\u884c\u6267\u884cPython\u811a\u672c\u8fd9\u4e00\u65b9\u6cd5\u8fdb\u884c\u8be6\u7ec6\u63cf\u8ff0\u3002<\/p>\n<\/p>\n<p><p>\u5728\u547d\u4ee4\u884c\u4e2d\u6267\u884cPython\u811a\u672c\u662f\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u4e4b\u4e00\u3002\u9996\u5148\uff0c\u786e\u4fdd\u60a8\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u5e76\u914d\u7f6e\u597d\u73af\u5883\u53d8\u91cf\u3002\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u63d0\u793a\u7b26\uff08cmd\uff09\u8fdb\u5165Python\u7684\u5b89\u88c5\u76ee\u5f55\uff0c\u6216\u8005\u76f4\u63a5\u5728\u4efb\u610f\u76ee\u5f55\u4e0b\u6267\u884cPython\u811a\u672c\u3002\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u5bfc\u822a\u5230Python\u811a\u672c\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\uff0c\u8f93\u5165\u547d\u4ee4<code>python script_name.py<\/code>\uff08\u5176\u4e2d<code>script_name.py<\/code>\u662f\u60a8\u7684Python\u6587\u4ef6\u540d\uff09\uff0c\u5e76\u6309\u4e0b\u56de\u8f66\u952e\u3002\u8fd9\u6837\uff0cPython\u89e3\u91ca\u5668\u5c06\u52a0\u8f7d\u5e76\u6267\u884c\u60a8\u7684\u811a\u672c\u6587\u4ef6\uff0c\u8f93\u51fa\u7ed3\u679c\u5c06\u663e\u793a\u5728\u547d\u4ee4\u884c\u7a97\u53e3\u4e2d\u3002<\/p>\n<\/p>\n<hr>\n<p><p>\u4e00\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u6267\u884cPython\u811a\u672c<\/p>\n<\/p>\n<p><p>\u4f7f\u7528\u547d\u4ee4\u884c\u6267\u884cPython\u811a\u672c\u662f\u4e00\u79cd\u7b80\u5355\u800c\u76f4\u63a5\u7684\u65b9\u6cd5\u3002\u5b83\u4e0d\u4f9d\u8d56\u4e8e\u4efb\u4f55\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\uff0c\u9002\u5408\u4e8e\u5feb\u901f\u6267\u884c\u811a\u672c\u548c\u81ea\u52a8\u5316\u4efb\u52a1\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5Python\u5e76\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u6267\u884cPython\u811a\u672c\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u5728\u60a8\u7684\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5\u4e86Python\u3002\u53ef\u4ee5\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"http:\/\/www.python.org%EF%BC%89%E4%B8%8B%E8%BD%BD%E5%B9%B6%E5%AE%89%E8%A3%85%E9%80%82%E5%90%88%E6%82%A8%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E7%9A%84%E7%89%88%E6%9C%AC%E3%80%82%E5%9C%A8%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B%E4%B8%AD%EF%BC%8C%E5%8A%A1%E5%BF%85%E5%8B%BE%E9%80%89%E2%80%9CAdd\">www.python.org\uff09\u4e0b\u8f7d\u5e76\u5b89\u88c5\u9002\u5408\u60a8\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\u3002\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u52a1\u5fc5\u52fe\u9009\u201cAdd<\/a> Python to PATH\u201d\u9009\u9879\uff0c\u4ee5\u786e\u4fddPython\u53ef\u88ab\u7cfb\u7edf\u8bc6\u522b\u3002<\/p>\n<\/p>\n<p><p>\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u662f\u4e3a\u4e86\u4f7fPython\u547d\u4ee4\u5728\u4efb\u4f55\u76ee\u5f55\u4e0b\u90fd\u80fd\u88ab\u8bc6\u522b\u3002\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u201c\u7cfb\u7edf\u5c5e\u6027\u201d -&gt; \u201c\u73af\u5883\u53d8\u91cf\u201d -&gt; \u201c\u7cfb\u7edf\u53d8\u91cf\u201d -&gt; \u201cPath\u201d\u4e2d\u6dfb\u52a0Python\u7684\u5b89\u88c5\u8def\u5f84\u3002Linux\u548cmacOS\u7528\u6237\u5219\u53ef\u4ee5\u901a\u8fc7\u7f16\u8f91<code>.bashrc<\/code>\u6216<code>.zshrc<\/code>\u6587\u4ef6\u6765\u6dfb\u52a0Python\u8def\u5f84\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef<\/strong><\/p>\n<\/p>\n<p><p>Windows\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u201c\u5f00\u59cb\u201d\u83dc\u5355\u641c\u7d22\u201ccmd\u201d\u6216\u201c\u547d\u4ee4\u63d0\u793a\u7b26\u201d\u6253\u5f00\u547d\u4ee4\u884c\u754c\u9762\u3002Linux\u548cmacOS\u7528\u6237\u53ef\u4ee5\u6253\u5f00\u201c\u7ec8\u7aef\u201d\uff08Terminal\uff09\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5bfc\u822a\u5230Python\u811a\u672c\u6240\u5728\u76ee\u5f55<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528\u547d\u4ee4\u884c\u7684<code>cd<\/code>\u547d\u4ee4\u5207\u6362\u5230\u60a8\u5b58\u653ePython\u811a\u672c\u7684\u76ee\u5f55\u3002\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u7684Python\u811a\u672c\u5b58\u653e\u5728<code>C:\\Scripts<\/code>\u76ee\u5f55\u4e0b\uff0c\u8f93\u5165<code>cd C:\\Scripts<\/code>\u5e76\u6309\u4e0b\u56de\u8f66\u952e\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6267\u884cPython\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python script_name.py<\/code>\uff08\u5c06<code>script_name.py<\/code>\u66ff\u6362\u4e3a\u60a8\u7684Python\u6587\u4ef6\u540d\uff09\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u952e\u3002Python\u89e3\u91ca\u5668\u5c06\u8bfb\u53d6\u5e76\u6267\u884c\u8be5\u811a\u672c\uff0c\u7ed3\u679c\u5c06\u663e\u793a\u5728\u547d\u4ee4\u884c\u7a97\u53e3\u4e2d\u3002<\/p>\n<\/p>\n<p><p>\u5982\u679c\u4f7f\u7528\u7684\u662fPython 3.x\u7248\u672c\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528<code>python3<\/code>\u547d\u4ee4\u6765\u6267\u884c\u811a\u672c\u3002\u4f8b\u5982\uff1a<code>python3 script_name.py<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/p>\n<\/p>\n<p><p>\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\u652f\u6301\uff0c\u5982\u4ee3\u7801\u7f16\u8f91\u3001\u8c03\u8bd5\u3001\u7248\u672c\u63a7\u5236\u7b49\uff0c\u4f7f\u5176\u6210\u4e3a\u7f16\u5199\u548c\u6267\u884cPython\u811a\u672c\u7684\u9996\u9009\u5de5\u5177\u4e4b\u4e00\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u9009\u62e9\u5408\u9002\u7684IDE<\/strong><\/p>\n<\/p>\n<p><p>\u5e38\u89c1\u7684Python IDE\u5305\u62ecPyCharm\u3001Visual Studio Code\uff08VSCode\uff09\u3001Jupyter Notebook\u3001Spyder\u7b49\u3002\u9009\u62e9\u4e00\u4e2a\u60a8\u4e60\u60ef\u6216\u559c\u6b22\u7684IDE\u8fdb\u884c\u5f00\u53d1\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u548c\u914d\u7f6eIDE<\/strong><\/p>\n<\/p>\n<p><p>\u4e0b\u8f7d\u5e76\u5b89\u88c5\u60a8\u9009\u62e9\u7684IDE\u3002\u5927\u591a\u6570IDE\u5728\u5b89\u88c5\u65f6\u4f1a\u81ea\u52a8\u68c0\u6d4b\u7cfb\u7edf\u4e2d\u7684Python\u8def\u5f84\u3002\u5982\u679c\u6ca1\u6709\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u624b\u52a8\u914d\u7f6ePython\u89e3\u91ca\u5668\u8def\u5f84\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efa\u6216\u5bfc\u5165Python\u9879\u76ee<\/strong><\/p>\n<\/p>\n<p><p>\u542f\u52a8IDE\u540e\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u9879\u76ee\u6216\u6253\u5f00\u5df2\u6709\u7684\u9879\u76ee\u3002\u5c06\u60a8\u7684Python\u811a\u672c\u6587\u4ef6\u653e\u7f6e\u5728\u9879\u76ee\u76ee\u5f55\u4e2d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6267\u884cPython\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u5728IDE\u4e2d\u6253\u5f00Python\u811a\u672c\u6587\u4ef6\uff0c\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7\u70b9\u51fb\u201c\u8fd0\u884c\u201d\uff08Run\uff09\u6309\u94ae\u6216\u6309\u4e0b\u5feb\u6377\u952e\uff08\u4f8b\u5982\uff0cVSCode\u4e2d\u662f<code>F5<\/code>\u952e\uff09\u6765\u6267\u884c\u811a\u672c\u3002IDE\u4f1a\u5728\u63a7\u5236\u53f0\u4e2d\u663e\u793a\u811a\u672c\u7684\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u901a\u8fc7\u8c03\u5ea6\u7a0b\u5e8f\u81ea\u52a8\u6267\u884cPython\u811a\u672c<\/p>\n<\/p>\n<p><p>\u6709\u65f6\u5019\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u5728\u7279\u5b9a\u65f6\u95f4\u95f4\u9694\u5185\u81ea\u52a8\u6267\u884cPython\u811a\u672c\u3002\u6b64\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u64cd\u4f5c\u7cfb\u7edf\u81ea\u5e26\u7684\u8c03\u5ea6\u7a0b\u5e8f\uff0c\u5982Windows\u4efb\u52a1\u8ba1\u5212\u7a0b\u5e8f\u3001Linux\u7684CronJob\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Windows\u4efb\u52a1\u8ba1\u5212\u7a0b\u5e8f<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u201c\u4efb\u52a1\u8ba1\u5212\u7a0b\u5e8f\u201d\u5e76\u521b\u5efa\u4e00\u4e2a\u57fa\u672c\u4efb\u52a1\u3002<\/li>\n<li>\u5728\u4efb\u52a1\u89e6\u53d1\u5668\u4e2d\u8bbe\u7f6e\u6267\u884c\u65f6\u95f4\u6216\u9891\u7387\u3002<\/li>\n<li>\u5728\u64cd\u4f5c\u4e2d\u9009\u62e9\u201c\u542f\u52a8\u7a0b\u5e8f\u201d\uff0c\u5e76\u6307\u5b9aPython\u89e3\u91ca\u5668\u53caPython\u811a\u672c\u7684\u8def\u5f84\u3002<\/li>\n<li>\u4fdd\u5b58\u4efb\u52a1\uff0c\u4efb\u52a1\u8ba1\u5212\u7a0b\u5e8f\u5c06\u5728\u8bbe\u5b9a\u7684\u65f6\u95f4\u81ea\u52a8\u8fd0\u884cPython\u811a\u672c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Linux CronJob<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u7ec8\u7aef\u5e76\u8f93\u5165<code>crontab -e<\/code>\u4ee5\u7f16\u8f91CronJob\u914d\u7f6e\u6587\u4ef6\u3002<\/li>\n<li>\u6dfb\u52a0\u4e00\u884c\u914d\u7f6e\u6765\u8bbe\u5b9a\u811a\u672c\u7684\u6267\u884c\u65f6\u95f4\u548c\u9891\u7387\u3002\u4f8b\u5982\uff0c\u6bcf\u5929\u5348\u591c\u6267\u884c\u811a\u672c\uff1a<code>0 0 * * * \/usr\/bin\/python3 \/path\/to\/script.py<\/code>\u3002<\/li>\n<li>\u4fdd\u5b58\u5e76\u9000\u51fa\u7f16\u8f91\uff0cCronJob\u5c06\u5728\u8bbe\u5b9a\u7684\u65f6\u95f4\u81ea\u52a8\u8fd0\u884cPython\u811a\u672c\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u4f7f\u7528\u865a\u62df\u73af\u5883\u6267\u884cPython\u811a\u672c<\/p>\n<\/p>\n<p><p>\u5728\u5927\u578b\u9879\u76ee\u6216\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u4f7f\u7528\u865a\u62df\u73af\u5883\u53ef\u4ee5\u9694\u79bb\u9879\u76ee\u7684\u4f9d\u8d56\u5305\uff0c\u9632\u6b62\u4e0d\u540c\u9879\u76ee\u4e4b\u95f4\u7684\u5305\u7248\u672c\u51b2\u7a81\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efa\u865a\u62df\u73af\u5883<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528\u547d\u4ee4<code>python -m venv env_name<\/code>\u521b\u5efa\u4e00\u4e2a\u865a\u62df\u73af\u5883\uff0c\u5176\u4e2d<code>env_name<\/code>\u4e3a\u865a\u62df\u73af\u5883\u7684\u540d\u79f0\u3002\u8be5\u547d\u4ee4\u5c06\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u865a\u62df\u73af\u5883\u76ee\u5f55\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6fc0\u6d3b\u865a\u62df\u73af\u5883<\/strong><\/p>\n<\/p>\n<ul>\n<li>Windows\u7528\u6237\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4<code>env_name\\Scripts\\activate<\/code>\u6fc0\u6d3b\u865a\u62df\u73af\u5883\u3002<\/li>\n<li>Linux\u548cmacOS\u7528\u6237\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4<code>source env_name\/bin\/activate<\/code>\u6fc0\u6d3b\u865a\u62df\u73af\u5883\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u9879\u76ee\u4f9d\u8d56<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u6fc0\u6d3b\u7684\u865a\u62df\u73af\u5883\u4e2d\uff0c\u4f7f\u7528<code>pip install package_name<\/code>\u547d\u4ee4\u6765\u5b89\u88c5\u9879\u76ee\u6240\u9700\u7684\u4f9d\u8d56\u5305\u3002\u8fd9\u6837\u5b89\u88c5\u7684\u5305\u53ea\u4f1a\u5b58\u5728\u4e8e\u8be5\u865a\u62df\u73af\u5883\u4e2d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6267\u884cPython\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u6fc0\u6d3b\u7684\u865a\u62df\u73af\u5883\u4e2d\u6267\u884cPython\u811a\u672c\u3002\u7531\u4e8e\u865a\u62df\u73af\u5883\u5df2\u7ecf\u9694\u79bb\u4e86\u4f9d\u8d56\u5305\uff0c\u786e\u4fdd\u4e86\u811a\u672c\u5728\u7279\u5b9a\u7684\u4f9d\u8d56\u73af\u5883\u4e0b\u8fd0\u884c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u591a\u79cd\u65b9\u5f0f\uff0c\u60a8\u53ef\u4ee5\u7075\u6d3b\u5730\u6267\u884cPython\u6587\u4ef6\u811a\u672c\uff0c\u4ee5\u6ee1\u8db3\u4e0d\u540c\u7684\u5f00\u53d1\u548c\u5e94\u7528\u9700\u6c42\u3002\u9009\u62e9\u5408\u9002\u7684\u65b9\u5f0f\u4e0d\u4ec5\u80fd\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\uff0c\u8fd8\u80fd\u589e\u5f3a\u811a\u672c\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u6267\u884cPython\u6587\u4ef6\u811a\u672c\uff1f<\/strong><br \/>\u5728Windows\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u63d0\u793a\u7b26\u6267\u884cPython\u6587\u4ef6\u3002\u9996\u5148\uff0c\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u5207\u6362\u5230\u5305\u542bPython\u811a\u672c\u7684\u76ee\u5f55\u3002\u8f93\u5165<code>python your_script.py<\/code>\u6765\u8fd0\u884c\u811a\u672c\u3002\u5728Mac\u6216Linux\u4e0a\uff0c\u6253\u5f00\u7ec8\u7aef\uff0c\u5bfc\u822a\u5230\u811a\u672c\u76ee\u5f55\uff0c\u540c\u6837\u4f7f\u7528<code>python your_script.py<\/code>\u6216<code>python3 your_script.py<\/code>\uff08\u6839\u636ePython\u7248\u672c\uff09\u6765\u6267\u884c\u3002<\/p>\n<p><strong>\u5982\u679c\u6211\u7684Python\u811a\u672c\u9700\u8981\u5916\u90e8\u5e93\uff0c\u6211\u8be5\u5982\u4f55\u5904\u7406\uff1f<\/strong><br \/>\u5728\u6267\u884c\u5305\u542b\u5916\u90e8\u5e93\u7684Python\u811a\u672c\u4e4b\u524d\uff0c\u786e\u4fdd\u5df2\u5b89\u88c5\u6240\u9700\u7684\u5e93\u3002\u53ef\u4ee5\u4f7f\u7528<code>pip install package_name<\/code>\u6765\u5b89\u88c5\u6240\u9700\u7684\u5e93\u3002\u5982\u679c\u4f7f\u7528\u865a\u62df\u73af\u5883\uff0c\u786e\u4fdd\u5728\u6fc0\u6d3b\u8be5\u73af\u5883\u540e\u6267\u884c\u811a\u672c\uff0c\u4ee5\u4fbf\u6b63\u786e\u52a0\u8f7d\u4f9d\u8d56\u9879\u3002<\/p>\n<p><strong>\u5982\u4f55\u901a\u8fc7IDE\u6267\u884cPython\u6587\u4ef6\u811a\u672c\uff1f<\/strong><br \/>\u8bb8\u591a\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u5982PyCharm\u3001VSCode\u6216Jupyter Notebook\u90fd\u63d0\u4f9b\u4e86\u7b80\u5355\u7684\u65b9\u5f0f\u6765\u8fd0\u884cPython\u811a\u672c\u3002\u5728IDE\u4e2d\u6253\u5f00\u811a\u672c\u6587\u4ef6\uff0c\u901a\u5e38\u53ef\u4ee5\u627e\u5230\u4e00\u4e2a\u201c\u8fd0\u884c\u201d\u6309\u94ae\uff0c\u6216\u8005\u4f7f\u7528\u5feb\u6377\u952e\uff08\u5982Shift + F10\u6216Ctrl + Shift + R\uff09\u6765\u6267\u884c\u811a\u672c\u3002\u8fd9\u79cd\u65b9\u5f0f\u4fbf\u4e8e\u8c03\u8bd5\u548c\u67e5\u770b\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u6267\u884cPython\u6587\u4ef6\u811a\u672c\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528\u547d\u4ee4\u884c\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u4ee5\u53ca\u8c03\u5ea6\u7a0b\u5e8f\u7b49\u3002\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u901a\u8fc7 [&hellip;]","protected":false},"author":3,"featured_media":991118,"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\/991107"}],"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=991107"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/991107\/revisions"}],"predecessor-version":[{"id":991123,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/991107\/revisions\/991123"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/991118"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=991107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=991107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=991107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}