{"id":939641,"date":"2024-12-26T20:39:42","date_gmt":"2024-12-26T12:39:42","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/939641.html"},"modified":"2024-12-26T20:39:43","modified_gmt":"2024-12-26T12:39:43","slug":"%e9%ba%92%e9%ba%9f%e5%a6%82%e4%bd%95%e6%89%93%e5%bc%80python","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/939641.html","title":{"rendered":"\u9e92\u9e9f\u5982\u4f55\u6253\u5f00python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25074615\/cc424b67-f4a5-4491-94c5-cf3f222120b0.webp\" alt=\"\u9e92\u9e9f\u5982\u4f55\u6253\u5f00python\" \/><\/p>\n<p><p> <strong>\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u6253\u5f00Python\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u3001\u56fe\u5f62\u754c\u9762\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\u7b49\u591a\u79cd\u65b9\u5f0f\u8fdb\u884c\u3002<\/strong>\u5176\u4e2d\uff0c\u4f7f\u7528\u547d\u4ee4\u884c\u662f\u6700\u76f4\u63a5\u7684\u65b9\u6cd5\uff0c\u53ea\u9700\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u201cpython\u201d\u6216\u201cpython3\u201d\u5373\u53ef\u542f\u52a8Python\u89e3\u91ca\u5668\u3002\u4ee5\u4e0b\u662f\u901a\u8fc7\u547d\u4ee4\u884c\u6253\u5f00Python\u7684\u8be6\u7ec6\u63cf\u8ff0\uff1a\u5728\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u6253\u5f00\u7ec8\u7aef\u540e\uff0c\u952e\u5165\u201cpython\u201d\u6216\u201cpython3\u201d\uff0c\u5982\u679c\u7cfb\u7edf\u4e2d\u5df2\u7ecf\u5b89\u88c5\u4e86Python\uff0c\u5219\u4f1a\u770b\u5230Python\u89e3\u91ca\u5668\u7684\u7248\u672c\u4fe1\u606f\u4ee5\u53ca\u4ea4\u4e92\u5f0f\u63d0\u793a\u7b26\uff0c\u8868\u660ePython\u5df2\u7ecf\u6210\u529f\u542f\u52a8\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165Python\u547d\u4ee4\u8fdb\u884c\u6d4b\u8bd5\u548c\u5f00\u53d1\u3002<\/p>\n<\/p>\n<hr>\n<p><p>\u4e00\u3001\u547d\u4ee4\u884c\u65b9\u5f0f\u6253\u5f00Python<\/p>\n<\/p>\n<p><p>\u5728\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u547d\u4ee4\u884c\u662f\u4e0e\u7cfb\u7edf\u4ea4\u4e92\u7684\u91cd\u8981\u5de5\u5177\u3002\u4f7f\u7528\u547d\u4ee4\u884c\u6253\u5f00Python\u662f\u4e00\u79cd\u5feb\u901f\u4e14\u9ad8\u6548\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6253\u5f00\u7ec8\u7aef<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u9e92\u9e9f\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5feb\u6377\u952e\u201cCtrl + Alt + T\u201d\u76f4\u63a5\u6253\u5f00\u7ec8\u7aef\uff0c\u6216\u8005\u5728\u5e94\u7528\u7a0b\u5e8f\u83dc\u5355\u4e2d\u627e\u5230\u7ec8\u7aef\u5e76\u542f\u52a8\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u542f\u52a8Python\u89e3\u91ca\u5668<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u201cpython\u201d\u6216\u201cpython3\u201d\uff0c\u7136\u540e\u6309\u4e0b\u201cEnter\u201d\u952e\u3002\u5982\u679c\u7cfb\u7edf\u4e2d\u5df2\u7ecf\u5b89\u88c5\u4e86Python\uff0c\u90a3\u4e48\u4f60\u4f1a\u770b\u5230\u7c7b\u4f3c\u201cPython 3.x.x\u201d\u8fd9\u6837\u7684\u7248\u672c\u4fe1\u606f\uff0c\u4ee5\u53ca\u201c&gt;&gt;&gt;\u201d\u7b26\u53f7\uff0c\u8fd9\u8868\u660e\u4f60\u5df2\u7ecf\u8fdb\u5165Python\u7684\u4ea4\u4e92\u5f0f\u73af\u5883\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4ea4\u4e92\u5f0f\u73af\u5883<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4ea4\u4e92\u5f0f\u73af\u5883\u4e2d\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u8f93\u5165Python\u4ee3\u7801\u5e76\u7acb\u5373\u67e5\u770b\u8f93\u51fa\u7ed3\u679c\u3002\u4f8b\u5982\uff0c\u8f93\u5165\u201cprint(&#39;Hello, World!&#39;)\u201d\u5e76\u6309\u4e0bEnter\u952e\uff0c\u4f60\u4f1a\u770b\u5230\u7ec8\u7aef\u8f93\u51fa\u201cHello, World!\u201d\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u56fe\u5f62\u754c\u9762\u65b9\u5f0f\u6253\u5f00Python<\/p>\n<\/p>\n<p><p>\u9664\u4e86\u547d\u4ee4\u884c\uff0c\u9e92\u9e9f\u7cfb\u7edf\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e9b\u56fe\u5f62\u5316\u7684\u5de5\u5177\u6765\u542f\u52a8Python\uff0c\u9002\u5408\u4e0d\u719f\u6089\u547d\u4ee4\u884c\u7684\u7528\u6237\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528Python\u56fe\u5f62\u5316\u754c\u9762<\/strong><\/p>\n<\/p>\n<p><p>\u67d0\u4e9b\u7248\u672c\u7684\u9e92\u9e9f\u7cfb\u7edf\u9884\u88c5\u4e86Python\u7684\u56fe\u5f62\u5316\u754c\u9762\uff0c\u6bd4\u5982IDLE\u3002\u4f60\u53ef\u4ee5\u5728\u5e94\u7528\u7a0b\u5e8f\u83dc\u5355\u4e2d\u627e\u5230\u201cIDLE\u201d\u6216\u8005\u201cPython GUI\u201d\uff0c\u70b9\u51fb\u540e\u5373\u53ef\u6253\u5f00\u4e00\u4e2a\u56fe\u5f62\u5316\u7684Python Shell\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u901a\u8fc7\u6587\u4ef6\u7ba1\u7406\u5668<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u6709Python\u811a\u672c\u6587\u4ef6\uff08.py\uff09\uff0c\u53ef\u4ee5\u901a\u8fc7\u53f3\u952e\u70b9\u51fb\u6587\u4ef6\uff0c\u7136\u540e\u9009\u62e9\u201c\u7528Python\u8fd0\u884c\u201d\u6216\u8005\u7c7b\u4f3c\u7684\u9009\u9879\u6765\u542f\u52a8Python\u811a\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/p>\n<\/p>\n<p><p>\u5bf9\u4e8e\u4e13\u4e1a\u7684\u5f00\u53d1\u8005\u6765\u8bf4\uff0c\u4f7f\u7528IDE\u662f\u8fdb\u884cPython\u5f00\u53d1\u7684\u6700\u4f73\u9009\u62e9\u3002IDE\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\u548c\u826f\u597d\u7684\u7528\u6237\u4f53\u9a8c\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5IDE<\/strong><\/p>\n<\/p>\n<p><p>\u5e38\u7528\u7684Python IDE\u6709PyCharm\u3001Visual Studio Code\u3001Eclipse+PyDev\u7b49\u3002\u5728\u9e92\u9e9f\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u8f6f\u4ef6\u7ba1\u7406\u5668\u6765\u5b89\u88c5\u8fd9\u4e9bIDE\u3002\u6bd4\u5982\uff0c\u6253\u5f00\u8f6f\u4ef6\u7ba1\u7406\u5668\uff0c\u641c\u7d22\u201cPyCharm\u201d\uff0c\u7136\u540e\u70b9\u51fb\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u914d\u7f6ePython\u89e3\u91ca\u5668<\/strong><\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u542f\u52a8IDE\u5e76\u5728\u8bbe\u7f6e\u4e2d\u914d\u7f6ePython\u89e3\u91ca\u5668\u3002\u5927\u591a\u6570IDE\u4f1a\u81ea\u52a8\u68c0\u6d4b\u7cfb\u7edf\u4e2d\u7684Python\u89e3\u91ca\u5668\uff0c\u4f60\u53ea\u9700\u786e\u8ba4\u5e76\u4fdd\u5b58\u5373\u53ef\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efa\u548c\u8fd0\u884cPython\u9879\u76ee<\/strong><\/p>\n<\/p>\n<p><p>\u5728IDE\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u9879\u76ee\uff0c\u5e76\u7f16\u5199\u4f60\u7684Python\u4ee3\u7801\u3002IDE\u901a\u5e38\u63d0\u4f9b\u4e86\u8fd0\u884c\u6309\u94ae\uff0c\u70b9\u51fb\u5373\u53ef\u8fd0\u884c\u4f60\u7684Python\u7a0b\u5e8f\uff0c\u5e76\u5728\u96c6\u6210\u7684\u7ec8\u7aef\u6216\u63a7\u5236\u53f0\u4e2d\u67e5\u770b\u8f93\u51fa\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u901a\u8fc7\u8fdc\u7a0b\u8fde\u63a5\u8fd0\u884cPython<\/p>\n<\/p>\n<p><p>\u5728\u4e00\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u901a\u8fc7\u8fdc\u7a0b\u8fde\u63a5\u5230\u9e92\u9e9f\u7cfb\u7edf\u4e0a\u8fd0\u884cPython\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528SSH\u8fde\u63a5<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u53e6\u4e00\u53f0\u8ba1\u7b97\u673a\u4e0a\u4f7f\u7528SSH\u5de5\u5177\u8fde\u63a5\u5230\u9e92\u9e9f\u7cfb\u7edf\u3002\u8fde\u63a5\u6210\u529f\u540e\uff0c\u4f60\u53ef\u4ee5\u50cf\u672c\u5730\u7ec8\u7aef\u4e00\u6837\u5728\u8fdc\u7a0b\u7ec8\u7aef\u4e2d\u8f93\u5165\u201cpython\u201d\u6216\u201cpython3\u201d\u6765\u542f\u52a8Python\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528Jupyter Notebook<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u5728\u8fdc\u7a0b\u7cfb\u7edf\u4e0a\u8fdb\u884c\u6570\u636e\u5206\u6790\u6216\u79d1\u5b66\u8ba1\u7b97\uff0c\u53ef\u4ee5\u5728\u9e92\u9e9f\u7cfb\u7edf\u4e0a\u5b89\u88c5Jupyter Notebook\u3002\u7136\u540e\uff0c\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee\u8fdc\u7a0bJupyter\u670d\u52a1\uff0c\u76f4\u63a5\u5728\u7f51\u9875\u4e2d\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001Python\u73af\u5883\u7ba1\u7406<\/p>\n<\/p>\n<p><p>\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u4e0d\u540c\u7248\u672c\u7684Python\u6216\u9694\u79bb\u7684\u73af\u5883\uff0c\u8fd9\u65f6Python\u73af\u5883\u7ba1\u7406\u5de5\u5177\u5c31\u663e\u5f97\u5c24\u4e3a\u91cd\u8981\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528Virtualenv<\/strong><\/p>\n<\/p>\n<p><p>Virtualenv\u662f\u4e00\u4e2a\u521b\u5efa\u9694\u79bbPython\u73af\u5883\u7684\u5de5\u5177\u3002\u5728\u9e92\u9e9f\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u201cpip install virtualenv\u201d\u5b89\u88c5\u5b83\u3002\u521b\u5efa\u65b0\u73af\u5883\u65f6\uff0c\u4f7f\u7528\u201cvirtualenv &lt;\u73af\u5883\u540d&gt;\u201d\uff0c\u7136\u540e\u901a\u8fc7\u201csource &lt;\u73af\u5883\u540d&gt;\/bin\/activate\u201d\u6fc0\u6d3b\u73af\u5883\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528Conda<\/strong><\/p>\n<\/p>\n<p><p>Conda\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u73af\u5883\u7ba1\u7406\u548c\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u7279\u522b\u9002\u5408\u6570\u636e\u79d1\u5b66\u9879\u76ee\u3002\u5728\u9e92\u9e9f\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u5b89\u88c5Anaconda\u6216Miniconda\u6765\u4f7f\u7528Conda\u3002\u521b\u5efa\u73af\u5883\u65f6\u4f7f\u7528\u201cconda create -n &lt;\u73af\u5883\u540d&gt; python=3.x\u201d\uff0c\u6fc0\u6d3b\u73af\u5883\u4f7f\u7528\u201cconda activate &lt;\u73af\u5883\u540d&gt;\u201d\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u516d\u3001Python\u5f00\u53d1\u6700\u4f73\u5b9e\u8df5<\/p>\n<\/p>\n<p><p>\u4e3a\u4e86\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u548c\u4ee3\u7801\u8d28\u91cf\uff0c\u9075\u5faa\u4e00\u4e9bPython\u5f00\u53d1\u7684\u6700\u4f73\u5b9e\u8df5\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u9075\u5faaPEP 8\u4ee3\u7801\u98ce\u683c<\/strong><\/p>\n<\/p>\n<p><p>PEP 8\u662fPython\u7684\u5b98\u65b9\u7f16\u7801\u98ce\u683c\u6307\u5357\uff0c\u5efa\u8bae\u5f00\u53d1\u8005\u9075\u5faa\u3002\u826f\u597d\u7684\u4ee3\u7801\u98ce\u683c\u53ef\u4ee5\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528\u7248\u672c\u63a7\u5236\u7cfb\u7edf<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u9879\u76ee\u5f00\u53d1\u4e2d\u4f7f\u7528Git\u7b49\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u53ef\u4ee5\u6709\u6548\u7ba1\u7406\u4ee3\u7801\u7684\u53d8\u5316\uff0c\u9632\u6b62\u6570\u636e\u4e22\u5931\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199\u6d4b\u8bd5<\/strong><\/p>\n<\/p>\n<p><p>\u4e3a\u4f60\u7684\u4ee3\u7801\u7f16\u5199\u5355\u5143\u6d4b\u8bd5\u548c\u96c6\u6210\u6d4b\u8bd5\uff0c\u53ef\u4ee5\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u9760\u6027\uff0c\u5e76\u5728\u4ee3\u7801\u53d8\u66f4\u65f6\u786e\u4fdd\u529f\u80fd\u4e0d\u88ab\u7834\u574f\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u5404\u4e2a\u65b9\u9762\u7684\u4ecb\u7ecd\uff0c\u76f8\u4fe1\u4f60\u53ef\u4ee5\u719f\u7ec3\u5730\u5728\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u6253\u5f00\u548c\u4f7f\u7528Python\u8fdb\u884c\u5f00\u53d1\u3002\u65e0\u8bba\u662f\u521d\u5b66\u8005\u8fd8\u662f\u6709\u7ecf\u9a8c\u7684\u5f00\u53d1\u8005\uff0c\u8fd9\u4e9b\u65b9\u6cd5\u548c\u6280\u5de7\u90fd\u80fd\u5e2e\u52a9\u4f60\u66f4\u9ad8\u6548\u5730\u8fdb\u884cPython\u7f16\u7a0b\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u652f\u6301\u54ea\u4e9b\u7248\u672c\u7684Python\uff1f<\/strong><br \/>\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u652f\u6301\u591a\u4e2a\u7248\u672c\u7684Python\uff0c\u5305\u62ecPython 2.x\u548cPython 3.x\u3002\u7528\u6237\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u7248\u672c\u6765\u8fdb\u884c\u5f00\u53d1\u3002\u901a\u5e38\uff0c\u5efa\u8bae\u4f7f\u7528Python 3.x\u7248\u672c\uff0c\u56e0\u4e3a\u5b83\u662f\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u672c\uff0c\u62e5\u6709\u66f4\u4e30\u5bcc\u7684\u529f\u80fd\u548c\u66f4\u597d\u7684\u793e\u533a\u652f\u6301\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u9e92\u9e9f\u4e0a\u5b89\u88c5Python\uff1f<\/strong><br \/>\u5728\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u5b89\u88c5Python\u53ef\u4ee5\u901a\u8fc7\u5305\u7ba1\u7406\u5de5\u5177\u8fdb\u884c\u3002\u7528\u6237\u53ef\u4ee5\u6253\u5f00\u7ec8\u7aef\uff0c\u4f7f\u7528\u547d\u4ee4\u5982<code>apt-get install python3<\/code>\u6765\u5b89\u88c5Python 3\uff0c\u6216\u8005\u4f7f\u7528<code>apt-get install python<\/code>\u6765\u5b89\u88c5Python 2\u3002\u786e\u4fdd\u5728\u5b89\u88c5\u524d\u66f4\u65b0\u5305\u5217\u8868\uff0c\u4f7f\u7528\u547d\u4ee4<code>apt-get update<\/code>\u3002<\/p>\n<p><strong>\u5728\u9e92\u9e9f\u4e2d\u5982\u4f55\u8fd0\u884cPython\u811a\u672c\uff1f<\/strong><br \/>\u5728\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u8fd0\u884cPython\u811a\u672c\u975e\u5e38\u7b80\u5355\u3002\u7528\u6237\u53ea\u9700\u5728\u7ec8\u7aef\u4e2d\u5bfc\u822a\u5230\u811a\u672c\u6240\u5728\u7684\u76ee\u5f55\uff0c\u4f7f\u7528\u547d\u4ee4<code>python3 script_name.py<\/code>\u6765\u6267\u884cPython 3\u811a\u672c\uff0c\u6216\u8005\u4f7f\u7528<code>python script_name.py<\/code>\u6765\u6267\u884cPython 2\u811a\u672c\u3002\u786e\u4fdd\u811a\u672c\u6587\u4ef6\u5177\u6709\u53ef\u6267\u884c\u6743\u9650\uff0c\u53ef\u4ee5\u901a\u8fc7<code>chmod +x script_name.py<\/code>\u547d\u4ee4\u6765\u8bbe\u7f6e\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u9e92\u9e9f\u4e2d\u4f7f\u7528Python\u7684\u865a\u62df\u73af\u5883\uff1f<\/strong><br \/>\u5728\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u7528\u6237\u53ef\u4ee5\u4f7f\u7528<code>venv<\/code>\u6a21\u5757\u6765\u521b\u5efaPython\u7684\u865a\u62df\u73af\u5883\u3002\u901a\u8fc7\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c<code>python3 -m venv myenv<\/code>\u547d\u4ee4\uff0c\u7528\u6237\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>myenv<\/code>\u7684\u865a\u62df\u73af\u5883\u3002\u6fc0\u6d3b\u73af\u5883\u540e\uff0c\u53ef\u4ee5\u5b89\u88c5\u7279\u5b9a\u9879\u76ee\u6240\u9700\u7684\u5305\uff0c\u800c\u4e0d\u5f71\u54cd\u5168\u5c40Python\u73af\u5883\u3002\u6fc0\u6d3b\u547d\u4ee4\u4e3a<code>source myenv\/bin\/activate<\/code>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u6253\u5f00Python\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u3001\u56fe\u5f62\u754c\u9762\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\u7b49\u591a\u79cd\u65b9\u5f0f\u8fdb\u884c\u3002\u5176\u4e2d\uff0c\u4f7f\u7528\u547d\u4ee4\u884c\u662f\u6700\u76f4\u63a5\u7684\u65b9 [&hellip;]","protected":false},"author":3,"featured_media":939645,"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\/939641"}],"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=939641"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/939641\/revisions"}],"predecessor-version":[{"id":939648,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/939641\/revisions\/939648"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/939645"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=939641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=939641"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=939641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}