{"id":1121984,"date":"2025-01-08T19:15:45","date_gmt":"2025-01-08T11:15:45","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1121984.html"},"modified":"2025-01-08T19:15:49","modified_gmt":"2025-01-08T11:15:49","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8vm%e8%99%9a%e6%8b%9f%e6%9c%ba%e9%87%8c%e4%bd%bf%e7%94%a8python","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1121984.html","title":{"rendered":"\u5982\u4f55\u5728VM\u865a\u62df\u673a\u91cc\u4f7f\u7528Python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25084016\/37d0c468-8eec-472e-a5e1-bdc94dbf5540.webp\" alt=\"\u5982\u4f55\u5728VM\u865a\u62df\u673a\u91cc\u4f7f\u7528Python\" \/><\/p>\n<p><p> <strong>\u5728VM\u865a\u62df\u673a\u91cc\u4f7f\u7528Python\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u9009\u62e9\u5408\u9002\u7684\u865a\u62df\u673a\u8f6f\u4ef6\u3001\u5b89\u88c5\u64cd\u4f5c\u7cfb\u7edf\u3001\u5b89\u88c5Python\u73af\u5883\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3001\u5b89\u88c5\u6240\u9700\u7684Python\u5e93\u3001\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801<\/strong>\u3002\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u5c55\u5f00\u8fd9\u51e0\u70b9\u5185\u5bb9\uff0c\u5e2e\u52a9\u4f60\u5728VM\u865a\u62df\u673a\u4e2d\u987a\u5229\u4f7f\u7528Python\u8fdb\u884c\u5f00\u53d1\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u9009\u62e9\u5408\u9002\u7684\u865a\u62df\u673a\u8f6f\u4ef6<\/h3>\n<\/p>\n<p><p>\u9009\u62e9\u5408\u9002\u7684\u865a\u62df\u673a\u8f6f\u4ef6\u662f\u4f7f\u7528Python\u7684\u7b2c\u4e00\u6b65\u3002\u76ee\u524d\u5e02\u9762\u4e0a\u5e38\u89c1\u7684\u865a\u62df\u673a\u8f6f\u4ef6\u6709VMware\u3001VirtualBox\u548cHyper-V\u7b49\u3002<\/p>\n<\/p>\n<p><h4>1. VMware<\/h4>\n<\/p>\n<p><p>VMware\u662f\u4e00\u6b3e\u975e\u5e38\u6210\u719f\u7684\u865a\u62df\u673a\u8f6f\u4ef6\uff0c\u5177\u6709\u5f3a\u5927\u7684\u529f\u80fd\u548c\u826f\u597d\u7684\u7528\u6237\u754c\u9762\u3002\u5b83\u652f\u6301\u591a\u79cd\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5305\u62ecWindows\u3001Linux\u548cmacOS\u7b49\u3002\u4f7f\u7528VMware\u53ef\u4ee5\u8f7b\u677e\u521b\u5efa\u548c\u7ba1\u7406\u865a\u62df\u673a\uff0c\u5e76\u4e14\u5176\u6027\u80fd\u8868\u73b0\u4e5f\u975e\u5e38\u4f18\u5f02\u3002<\/p>\n<\/p>\n<p><h4>2. VirtualBox<\/h4>\n<\/p>\n<p><p>VirtualBox\u662f\u7531Oracle\u5f00\u53d1\u7684\u4e00\u6b3e\u5f00\u6e90\u865a\u62df\u673a\u8f6f\u4ef6\uff0c\u652f\u6301\u591a\u79cd\u64cd\u4f5c\u7cfb\u7edf\u3002\u5b83\u7684\u4f18\u52bf\u5728\u4e8e\u514d\u8d39\u4e14\u5f00\u6e90\uff0c\u529f\u80fd\u4e5f\u975e\u5e38\u5f3a\u5927\uff0c\u8db3\u591f\u6ee1\u8db3\u5927\u591a\u6570\u5f00\u53d1\u8005\u7684\u9700\u6c42\u3002VirtualBox\u7684\u754c\u9762\u7b80\u6d01\u6613\u7528\uff0c\u662f\u5f88\u591a\u5f00\u53d1\u8005\u7684\u9996\u9009\u3002<\/p>\n<\/p>\n<p><h4>3. Hyper-V<\/h4>\n<\/p>\n<p><p>Hyper-V\u662f\u5fae\u8f6f\u63d0\u4f9b\u7684\u4e00\u6b3e\u865a\u62df\u673a\u7ba1\u7406\u5de5\u5177\uff0c\u96c6\u6210\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u3002\u5bf9\u4e8e\u4f7f\u7528Windows\u64cd\u4f5c\u7cfb\u7edf\u7684\u7528\u6237\u6765\u8bf4\uff0cHyper-V\u662f\u4e00\u4e2a\u975e\u5e38\u65b9\u4fbf\u7684\u9009\u62e9\uff0c\u4e0d\u9700\u8981\u989d\u5916\u5b89\u88c5\u7b2c\u4e09\u65b9\u8f6f\u4ef6\u5373\u53ef\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u5b89\u88c5\u64cd\u4f5c\u7cfb\u7edf<\/h3>\n<\/p>\n<p><p>\u5b89\u88c5\u64cd\u4f5c\u7cfb\u7edf\u662f\u4f7f\u7528Python\u7684\u7b2c\u4e8c\u6b65\u3002\u4e0d\u540c\u7684\u865a\u62df\u673a\u8f6f\u4ef6\u5728\u5b89\u88c5\u64cd\u4f5c\u7cfb\u7edf\u7684\u6b65\u9aa4\u4e0a\u7565\u6709\u4e0d\u540c\uff0c\u4f46\u603b\u4f53\u6d41\u7a0b\u5927\u540c\u5c0f\u5f02\u3002<\/p>\n<\/p>\n<p><h4>1. \u4e0b\u8f7d\u64cd\u4f5c\u7cfb\u7edf\u955c\u50cf<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u4f60\u9700\u8981\u4e0b\u8f7d\u4f60\u6240\u9700\u7684\u64cd\u4f5c\u7cfb\u7edf\u955c\u50cf\u6587\u4ef6\uff08ISO\u6587\u4ef6\uff09\u3002\u5e38\u89c1\u7684\u64cd\u4f5c\u7cfb\u7edf\u5305\u62ecWindows\u3001Ubuntu\u3001CentOS\u7b49\u3002\u4f60\u53ef\u4ee5\u4ece\u76f8\u5e94\u7684\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u8fd9\u4e9b\u955c\u50cf\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h4>2. \u521b\u5efa\u65b0\u7684\u865a\u62df\u673a<\/h4>\n<\/p>\n<p><p>\u6253\u5f00\u865a\u62df\u673a\u8f6f\u4ef6\uff0c\u9009\u62e9\u521b\u5efa\u65b0\u7684\u865a\u62df\u673a\u3002\u6839\u636e\u63d0\u793a\u9009\u62e9\u64cd\u4f5c\u7cfb\u7edf\u7c7b\u578b\u548c\u7248\u672c\uff0c\u5206\u914d\u5408\u9002\u7684\u786c\u4ef6\u8d44\u6e90\uff08\u5982CPU\u3001\u5185\u5b58\u548c\u786c\u76d8\u7a7a\u95f4\uff09\u3002<\/p>\n<\/p>\n<p><h4>3. \u5b89\u88c5\u64cd\u4f5c\u7cfb\u7edf<\/h4>\n<\/p>\n<p><p>\u5c06\u4e0b\u8f7d\u597d\u7684\u64cd\u4f5c\u7cfb\u7edf\u955c\u50cf\u6587\u4ef6\u6302\u8f7d\u5230\u865a\u62df\u673a\u4e2d\uff0c\u542f\u52a8\u865a\u62df\u673a\u5e76\u6309\u7167\u63d0\u793a\u5b8c\u6210\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u8fc7\u7a0b\u3002\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9700\u8981\u8bbe\u7f6e\u4e00\u4e9b\u57fa\u672c\u4fe1\u606f\uff0c\u5982\u8bed\u8a00\u3001\u65f6\u533a\u3001\u7528\u6237\u540d\u548c\u5bc6\u7801\u7b49\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u5b89\u88c5Python\u73af\u5883<\/h3>\n<\/p>\n<p><p>\u5b89\u88c5Python\u73af\u5883\u662f\u4f7f\u7528Python\u7684\u7b2c\u4e09\u6b65\u3002\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u5728\u5b89\u88c5Python\u65f6\u6709\u6240\u4e0d\u540c\u3002<\/p>\n<\/p>\n<p><h4>1. \u5728Windows\u4e0a\u5b89\u88c5Python<\/h4>\n<\/p>\n<ul>\n<li>\u4e0b\u8f7dPython\u5b89\u88c5\u5305\uff1a\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff0c\u4e0b\u8f7d\u9002\u5408Windows\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\u3002<\/li>\n<li>\u8fd0\u884c\u5b89\u88c5\u5305\uff1a\u53cc\u51fb\u4e0b\u8f7d\u7684\u5b89\u88c5\u5305\uff0c\u6839\u636e\u63d0\u793a\u5b8c\u6210\u5b89\u88c5\u8fc7\u7a0b\u3002\u5efa\u8bae\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u65b9\u4fbf\u540e\u7eed\u4f7f\u7528\u3002<\/li>\n<li>\u9a8c\u8bc1\u5b89\u88c5\uff1a\u6253\u5f00\u547d\u4ee4\u884c\u7a97\u53e3\uff0c\u8f93\u5165<code>python --version<\/code>\uff0c\u5982\u679c\u663e\u793aPython\u7248\u672c\u53f7\uff0c\u5219\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002<\/li>\n<\/ul>\n<p><h4>2. \u5728Linux\u4e0a\u5b89\u88c5Python<\/h4>\n<\/p>\n<ul>\n<li>\u66f4\u65b0\u8f6f\u4ef6\u5305\u5217\u8868\uff1a\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>sudo apt-get update<\/code>\u3002<\/li>\n<li>\u5b89\u88c5Python\uff1a\u8f93\u5165<code>sudo apt-get install python3<\/code>\uff0c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u4e0b\u8f7d\u5e76\u5b89\u88c5Python\u3002<\/li>\n<li>\u9a8c\u8bc1\u5b89\u88c5\uff1a\u8f93\u5165<code>python3 --version<\/code>\uff0c\u5982\u679c\u663e\u793aPython\u7248\u672c\u53f7\uff0c\u5219\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002<\/li>\n<\/ul>\n<p><h3>\u56db\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/h3>\n<\/p>\n<p><p>\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u662f\u4f7f\u7528Python\u7684\u7b2c\u56db\u6b65\u3002\u6b63\u786e\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u53ef\u4ee5\u8ba9\u4f60\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u4f7f\u7528Python\u547d\u4ee4\u3002<\/p>\n<\/p>\n<p><h4>1. \u5728Windows\u4e0a\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/h4>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u7cfb\u7edf\u5c5e\u6027\uff1a\u53f3\u952e\u70b9\u51fb\u201c\u6b64\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<\/li>\n<li>\u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff1a\u5728\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\u7a97\u53e3\u4e2d\uff0c\u70b9\u51fb\u201c\u73af\u5883\u53d8\u91cf\u201d\u6309\u94ae\u3002\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u90e8\u5206\u627e\u5230<code>Path<\/code>\u53d8\u91cf\uff0c\u70b9\u51fb\u201c\u7f16\u8f91\u201d\uff0c\u5c06Python\u7684\u5b89\u88c5\u8def\u5f84\u6dfb\u52a0\u8fdb\u53bb\u3002<\/li>\n<\/ul>\n<p><h4>2. \u5728Linux\u4e0a\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/h4>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165<code>nano ~\/.bashrc<\/code>\u3002<\/li>\n<li>\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0<code>export PATH=$PATH:\/usr\/bin\/python3<\/code>\uff0c\u4fdd\u5b58\u5e76\u9000\u51fa\u3002<\/li>\n<li>\u8f93\u5165<code>source ~\/.bashrc<\/code>\u8ba9\u914d\u7f6e\u751f\u6548\u3002<\/li>\n<\/ul>\n<p><h3>\u4e94\u3001\u5b89\u88c5\u6240\u9700\u7684Python\u5e93<\/h3>\n<\/p>\n<p><p>\u5b89\u88c5\u6240\u9700\u7684Python\u5e93\u662f\u4f7f\u7528Python\u7684\u7b2c\u4e94\u6b65\u3002Python\u6709\u4e30\u5bcc\u7684\u7b2c\u4e09\u65b9\u5e93\uff0c\u80fd\u591f\u6781\u5927\u5730\u63d0\u5347\u5f00\u53d1\u6548\u7387\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528pip\u5b89\u88c5\u5e93<\/h4>\n<\/p>\n<ul>\n<li>\u5b89\u88c5pip\uff1a\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>sudo apt-get install python3-pip<\/code>\uff08Linux\uff09\u6216\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python -m ensurepip<\/code>\uff08Windows\uff09\u3002<\/li>\n<li>\u5b89\u88c5\u5e93\uff1a\u4f7f\u7528\u547d\u4ee4<code>pip install \u5e93\u540d<\/code>\u6765\u5b89\u88c5\u6240\u9700\u7684\u5e93\u3002\u4f8b\u5982\uff0c\u5b89\u88c5NumPy\u5e93\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4<code>pip install numpy<\/code>\u3002<\/li>\n<\/ul>\n<p><h4>2. \u4f7f\u7528conda\u5b89\u88c5\u5e93<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662fAnaconda\u73af\u5883\uff0c\u53ef\u4ee5\u4f7f\u7528<code>conda install \u5e93\u540d<\/code>\u6765\u5b89\u88c5\u6240\u9700\u7684\u5e93\u3002\u4f8b\u5982\uff0c\u5b89\u88c5Pandas\u5e93\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4<code>conda install pandas<\/code>\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801<\/h3>\n<\/p>\n<p><p>\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u662f\u4f7f\u7528Python\u7684\u7b2c\u516d\u6b65\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u5de5\u5177\u6765\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\uff0c\u5982IDLE\u3001PyCharm\u3001Jupyter Notebook\u7b49\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528IDLE<\/h4>\n<\/p>\n<p><p>IDLE\u662fPython\u81ea\u5e26\u7684\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff0c\u9002\u5408\u521d\u5b66\u8005\u4f7f\u7528\u3002\u6253\u5f00IDLE\uff0c\u70b9\u51fb\u201cFile\u201d\u83dc\u5355\uff0c\u9009\u62e9\u201cNew File\u201d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u6587\u4ef6\u3002\u5728\u65b0\u6587\u4ef6\u4e2d\u7f16\u5199Python\u4ee3\u7801\uff0c\u4fdd\u5b58\u540e\u70b9\u51fb\u201cRun\u201d\u83dc\u5355\uff0c\u9009\u62e9\u201cRun Module\u201d\u8fd0\u884c\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h4>2. \u4f7f\u7528PyCharm<\/h4>\n<\/p>\n<p><p>PyCharm\u662f\u4e00\u6b3e\u529f\u80fd\u5f3a\u5927\u7684Python\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff0c\u9002\u5408\u4e13\u4e1a\u5f00\u53d1\u8005\u4f7f\u7528\u3002\u5b89\u88c5\u5e76\u6253\u5f00PyCharm\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\u3002\u5728\u9879\u76ee\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u6587\u4ef6\uff0c\u7f16\u5199\u4ee3\u7801\u540e\u70b9\u51fb\u201cRun\u201d\u6309\u94ae\u8fd0\u884c\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h4>3. \u4f7f\u7528Jupyter Notebook<\/h4>\n<\/p>\n<p><p>Jupyter Notebook\u662f\u4e00\u6b3e\u4ea4\u4e92\u5f0f\u7b14\u8bb0\u672c\u5de5\u5177\uff0c\u975e\u5e38\u9002\u5408\u6570\u636e\u5206\u6790\u548c\u79d1\u5b66\u8ba1\u7b97\u3002\u5b89\u88c5\u5e76\u6253\u5f00Jupyter Notebook\uff0c\u5728\u6d4f\u89c8\u5668\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u7b14\u8bb0\u672c\u3002\u5728\u7b14\u8bb0\u672c\u4e2d\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\uff0c\u7ed3\u679c\u4f1a\u7acb\u5373\u663e\u793a\u5728\u9875\u9762\u4e0a\u3002<\/p>\n<\/p>\n<p><h3>\u4e03\u3001\u8c03\u8bd5\u548c\u4f18\u5316Python\u4ee3\u7801<\/h3>\n<\/p>\n<p><p>\u8c03\u8bd5\u548c\u4f18\u5316Python\u4ee3\u7801\u662f\u4f7f\u7528Python\u7684\u7b2c\u4e03\u6b65\u3002\u826f\u597d\u7684\u8c03\u8bd5\u548c\u4f18\u5316\u65b9\u6cd5\u53ef\u4ee5\u63d0\u9ad8\u4ee3\u7801\u7684\u8d28\u91cf\u548c\u8fd0\u884c\u6548\u7387\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528print\u8bed\u53e5\u8c03\u8bd5<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528<code>print<\/code>\u8bed\u53e5\u662f\u6700\u7b80\u5355\u7684\u8c03\u8bd5\u65b9\u6cd5\u3002\u5728\u4ee3\u7801\u4e2d\u63d2\u5165<code>print<\/code>\u8bed\u53e5\uff0c\u53ef\u4ee5\u8f93\u51fa\u53d8\u91cf\u7684\u503c\u548c\u7a0b\u5e8f\u7684\u8fd0\u884c\u72b6\u6001\uff0c\u5e2e\u52a9\u4f60\u627e\u5230\u95ee\u9898\u6240\u5728\u3002<\/p>\n<\/p>\n<p><h4>2. \u4f7f\u7528\u65ad\u70b9\u8c03\u8bd5<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08\u5982PyCharm\uff09\u53ef\u4ee5\u8bbe\u7f6e\u65ad\u70b9\u8fdb\u884c\u8c03\u8bd5\u3002\u8fd0\u884c\u7a0b\u5e8f\u65f6\uff0c\u5f53\u7a0b\u5e8f\u8fd0\u884c\u5230\u65ad\u70b9\u5904\u4f1a\u6682\u505c\uff0c\u5141\u8bb8\u4f60\u68c0\u67e5\u53d8\u91cf\u7684\u503c\u548c\u7a0b\u5e8f\u7684\u6267\u884c\u6d41\u7a0b\u3002<\/p>\n<\/p>\n<p><h4>3. \u4f18\u5316\u4ee3\u7801\u6027\u80fd<\/h4>\n<\/p>\n<p><p>\u4f18\u5316\u4ee3\u7801\u6027\u80fd\u53ef\u4ee5\u63d0\u9ad8\u7a0b\u5e8f\u7684\u8fd0\u884c\u6548\u7387\u3002\u5e38\u89c1\u7684\u4f18\u5316\u65b9\u6cd5\u5305\u62ec\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u8ba1\u7b97\u3001\u4f7f\u7528\u9ad8\u6548\u7684\u6570\u636e\u7ed3\u6784\u548c\u7b97\u6cd5\u3001\u907f\u514d\u91cd\u590d\u8ba1\u7b97\u7b49\u3002<\/p>\n<\/p>\n<p><h3>\u516b\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728VM\u865a\u62df\u673a\u91cc\u4f7f\u7528Python\u7684\u65b9\u6cd5\u5305\u62ec\u9009\u62e9\u5408\u9002\u7684\u865a\u62df\u673a\u8f6f\u4ef6\u3001\u5b89\u88c5\u64cd\u4f5c\u7cfb\u7edf\u3001\u5b89\u88c5Python\u73af\u5883\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3001\u5b89\u88c5\u6240\u9700\u7684Python\u5e93\u3001\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u3001\u8c03\u8bd5\u548c\u4f18\u5316Python\u4ee3\u7801\u3002\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u591f\u5e2e\u52a9\u4f60\u5728VM\u865a\u62df\u673a\u4e2d\u987a\u5229\u4f7f\u7528Python\u8fdb\u884c\u5f00\u53d1\u3002\u5982\u679c\u4f60\u6709\u4efb\u4f55\u95ee\u9898\u6216\u5efa\u8bae\uff0c\u6b22\u8fce\u5728\u8bc4\u8bba\u533a\u7559\u8a00\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5728VM\u865a\u62df\u673a\u4e2d\u5b89\u88c5Python\u7684\u6b65\u9aa4\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u5728VM\u865a\u62df\u673a\u4e2d\u5b89\u88c5Python\u7684\u6b65\u9aa4\u5305\u62ec\uff1a\u9996\u5148\uff0c\u786e\u4fdd\u865a\u62df\u673a\u5df2\u7ecf\u5b89\u88c5\u4e86\u5408\u9002\u7684\u64cd\u4f5c\u7cfb\u7edf\u3002\u63a5\u4e0b\u6765\uff0c\u53ef\u4ee5\u901a\u8fc7\u5305\u7ba1\u7406\u5668\uff08\u5982apt-get\u3001yum\u7b49\uff09\u6765\u5b89\u88c5Python\uff0c\u6216\u8005\u76f4\u63a5\u4ecePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5b89\u88c5\u5305\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u8f93\u5165<code>python --version<\/code>\u6765\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728VM\u865a\u62df\u673a\u4e2d\u8fd0\u884cPython\u811a\u672c\uff1f<\/strong><br \/>\u5728\u865a\u62df\u673a\u4e2d\u8fd0\u884cPython\u811a\u672c\u975e\u5e38\u7b80\u5355\u3002\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u8fdb\u5165\u811a\u672c\u6240\u5728\u7684\u76ee\u5f55\uff0c\u4f7f\u7528\u547d\u4ee4<code>python script_name.py<\/code>\u6765\u6267\u884c\u811a\u672c\u3002\u786e\u4fdd\u5728\u8fd0\u884c\u4e4b\u524d\uff0c\u811a\u672c\u6587\u4ef6\u5177\u6709\u6b63\u786e\u7684\u6743\u9650\uff0c\u5e76\u4e14Python\u73af\u5883\u914d\u7f6e\u6b63\u5e38\u3002<\/p>\n<p><strong>\u5728VM\u865a\u62df\u673a\u4e2d\u4f7f\u7528Python\u5f00\u53d1\u73af\u5883\u7684\u63a8\u8350\u6709\u54ea\u4e9b\uff1f<\/strong><br \/>\u63a8\u8350\u7684Python\u5f00\u53d1\u73af\u5883\u5305\u62ecPyCharm\u3001VS Code\u548cJupyter Notebook\u7b49\u3002\u7528\u6237\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684IDE\u3002\u5bf9\u4e8e\u8f7b\u91cf\u7ea7\u7684\u9879\u76ee\uff0cVS Code\u548cJupyter Notebook\u975e\u5e38\u53d7\u6b22\u8fce\uff0c\u800c\u5bf9\u4e8e\u5927\u578b\u9879\u76ee\uff0cPyCharm\u63d0\u4f9b\u4e86\u66f4\u5168\u9762\u7684\u529f\u80fd\u652f\u6301\u3002\u6b64\u5916\uff0c\u786e\u4fdd\u865a\u62df\u673a\u7684\u6027\u80fd\u8db3\u591f\u652f\u6491\u6240\u9009\u5f00\u53d1\u73af\u5883\u7684\u8fd0\u884c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728VM\u865a\u62df\u673a\u91cc\u4f7f\u7528Python\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u9009\u62e9\u5408\u9002\u7684\u865a\u62df\u673a\u8f6f\u4ef6\u3001\u5b89\u88c5\u64cd\u4f5c\u7cfb\u7edf\u3001\u5b89\u88c5Python\u73af\u5883\u3001\u914d\u7f6e\u73af\u5883\u53d8 [&hellip;]","protected":false},"author":3,"featured_media":1121990,"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\/1121984"}],"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=1121984"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1121984\/revisions"}],"predecessor-version":[{"id":1121991,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1121984\/revisions\/1121991"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1121990"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1121984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1121984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1121984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}