{"id":1168922,"date":"2025-01-15T16:04:11","date_gmt":"2025-01-15T08:04:11","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1168922.html"},"modified":"2025-01-15T16:04:14","modified_gmt":"2025-01-15T08:04:14","slug":"%e5%a6%82%e4%bd%95%e4%b8%8b%e8%bd%bd%e4%b8%ad%e6%96%87%e7%89%88python","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1168922.html","title":{"rendered":"\u5982\u4f55\u4e0b\u8f7d\u4e2d\u6587\u7248python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/26070034\/8786eb90-67d6-43d6-a1c5-f4990528730f.webp\" alt=\"\u5982\u4f55\u4e0b\u8f7d\u4e2d\u6587\u7248python\" \/><\/p>\n<p><p> \u8981\u4e0b\u8f7d\u4e2d\u6587\u7248\u7684Python\uff0c\u4f60\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u64cd\u4f5c\uff1a<strong>\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\u3001\u9009\u62e9\u5408\u9002\u7684Python\u7248\u672c\u3001\u4e0b\u8f7d\u5e76\u5b89\u88c5\u3001\u914d\u7f6e\u4e2d\u6587\u73af\u5883<\/strong>\u3002\u5176\u4e2d\uff0c<strong>\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9<\/strong>\u662f\u7b2c\u4e00\u6b65\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u8bbf\u95eePython\u5b98\u65b9\u7ad9\u70b9\uff08<a href=\"http:\/\/www.python.org%EF%BC%89%E6%9D%A5%E8%8E%B7%E5%8F%96%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%AC%E7%9A%84Python%E3%80%82\">www.python.org\uff09\u6765\u83b7\u53d6\u6700\u65b0\u7248\u672c\u7684Python\u3002<\/a><\/p>\n<\/p>\n<p><p>\u4e0b\u8f7dPython\u4e2d\u6587\u7248\u7684\u5177\u4f53\u64cd\u4f5c\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9<\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff1a<a href=\"http:\/\/www.python.org%E3%80%82\">www.python.org\u3002<\/a><\/li>\n<li>\u5728\u9996\u9875\u9876\u90e8\u5bfc\u822a\u680f\u4e2d\u9009\u62e9\u201cDownloads\u201d\uff08\u4e0b\u8f7d\uff09\u9009\u9879\u3002<\/li>\n<li>\u6839\u636e\u4f60\u7684\u64cd\u4f5c\u7cfb\u7edf\uff08Windows\u3001macOS\u6216Linux\uff09\uff0c\u9009\u62e9\u5bf9\u5e94\u7684\u4e0b\u8f7d\u94fe\u63a5\u3002\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u5b98\u65b9\u7f51\u7ad9\u4f1a\u81ea\u52a8\u68c0\u6d4b\u4f60\u7684\u64cd\u4f5c\u7cfb\u7edf\u5e76\u63a8\u8350\u5408\u9002\u7684\u7248\u672c\u3002<\/li>\n<\/ul>\n<p><p>\u4e8c\u3001\u9009\u62e9\u5408\u9002\u7684Python\u7248\u672c<\/p>\n<\/p>\n<ul>\n<li>\u5728\u4e0b\u8f7d\u9875\u9762\uff0c\u4f60\u4f1a\u770b\u5230\u591a\u4e2a\u7248\u672c\u7684Python\u53ef\u4f9b\u9009\u62e9\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u5efa\u8bae\u4e0b\u8f7d\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u672c\uff08\u5982Python 3.x\u7cfb\u5217\uff09\u3002<\/li>\n<li>\u70b9\u51fb\u4e0b\u8f7d\u94fe\u63a5\uff0c\u5f00\u59cb\u4e0b\u8f7dPython\u5b89\u88c5\u5305\u3002<\/li>\n<\/ul>\n<p><p>\u4e09\u3001\u4e0b\u8f7d\u5e76\u5b89\u88c5<\/p>\n<\/p>\n<ul>\n<li>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u8fd0\u884c\u5b89\u88c5\u5305\u3002\u5b89\u88c5\u5411\u5bfc\u4f1a\u5f15\u5bfc\u4f60\u5b8c\u6210\u5b89\u88c5\u8fc7\u7a0b\u3002\u6ce8\u610f\uff0c\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u8fd9\u5c06\u6709\u52a9\u4e8e\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u4f7f\u7528Python\u3002<\/li>\n<li>\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5b89\u88c5\u8fc7\u7a0b\uff0c\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165\u201cpython\u201d\u6765\u68c0\u67e5\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002<\/li>\n<\/ul>\n<p><p>\u56db\u3001\u914d\u7f6e\u4e2d\u6587\u73af\u5883<\/p>\n<\/p>\n<ul>\n<li>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cPython\u7684\u754c\u9762\u548c\u6587\u6863\u662f\u82f1\u6587\u7684\u3002\u5982\u679c\u9700\u8981\u4e2d\u6587\u754c\u9762\uff0c\u53ef\u4ee5\u4f7f\u7528\u7b2c\u4e09\u65b9\u7684\u4e2d\u6587\u5316\u5305\u6216\u63d2\u4ef6\u3002<\/li>\n<li>\u5b89\u88c5\u4e2d\u6587\u5316\u5305\u7684\u65b9\u6cd5\u5982\u4e0b\uff1a\n<ol>\n<li>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\u3002<\/li>\n<li>\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u4e2d\u6587\u5316\u5305\uff1a<code>pip install zhconv<\/code><\/li>\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6839\u636e\u5177\u4f53\u9700\u6c42\u4f7f\u7528\u4e2d\u6587\u5316\u5305\u8fdb\u884c\u914d\u7f6e\u3002<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p><h3>\u4e00\u3001\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9<\/h3>\n<\/p>\n<p><p>Python\u5b98\u65b9\u7f51\u7ad9\u662f\u83b7\u53d6\u6700\u65b0\u7248\u672cPython\u7684\u6700\u4f73\u9014\u5f84\u3002\u5b98\u65b9\u7f51\u7ad9\u4e0d\u4ec5\u63d0\u4f9b\u4e86\u6700\u65b0\u7684\u5b89\u88c5\u5305\uff0c\u8fd8\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u6587\u6863\u548c\u8d44\u6e90\u4f9b\u7528\u6237\u5b66\u4e60\u548c\u4f7f\u7528Python\u3002\u4ee5\u4e0b\u662f\u8bbf\u95ee\u548c\u4e0b\u8f7dPython\u7684\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff1a<a href=\"http:\/\/www.python.org%E3%80%82\">www.python.org\u3002<\/a><\/li>\n<li>\u5728\u9996\u9875\u9876\u90e8\u5bfc\u822a\u680f\u4e2d\u9009\u62e9\u201cDownloads\u201d\uff08\u4e0b\u8f7d\uff09\u9009\u9879\u3002<\/li>\n<li>\u6839\u636e\u4f60\u7684\u64cd\u4f5c\u7cfb\u7edf\uff08Windows\u3001macOS\u6216Linux\uff09\uff0c\u9009\u62e9\u5bf9\u5e94\u7684\u4e0b\u8f7d\u94fe\u63a5\u3002\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u5b98\u65b9\u7f51\u7ad9\u4f1a\u81ea\u52a8\u68c0\u6d4b\u4f60\u7684\u64cd\u4f5c\u7cfb\u7edf\u5e76\u63a8\u8350\u5408\u9002\u7684\u7248\u672c\u3002<\/li>\n<\/ol>\n<p><h3>\u4e8c\u3001\u9009\u62e9\u5408\u9002\u7684Python\u7248\u672c<\/h3>\n<\/p>\n<p><p>\u5728\u4e0b\u8f7d\u9875\u9762\uff0c\u4f60\u4f1a\u770b\u5230\u591a\u4e2a\u7248\u672c\u7684Python\u53ef\u4f9b\u9009\u62e9\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u5efa\u8bae\u4e0b\u8f7d\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u672c\uff08\u5982Python 3.x\u7cfb\u5217\uff09\u3002Python 2.x\u7cfb\u5217\u5df2\u7ecf\u4e0d\u518d\u8fdb\u884c\u5b98\u65b9\u7ef4\u62a4\uff0c\u5efa\u8bae\u65b0\u7528\u6237\u9009\u62e9Python 3.x\u7cfb\u5217\u3002\u4ee5\u4e0b\u662f\u9009\u62e9Python\u7248\u672c\u7684\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u5728\u4e0b\u8f7d\u9875\u9762\uff0c\u67e5\u770b\u63a8\u8350\u7684Python\u7248\u672c\u3002\u5982\u679c\u4f60\u4e0d\u786e\u5b9a\u9009\u62e9\u54ea\u4e2a\u7248\u672c\uff0c\u53ef\u4ee5\u9009\u62e9\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u672c\uff08\u5982Python 3.x\u7cfb\u5217\uff09\u3002<\/li>\n<li>\u70b9\u51fb\u4e0b\u8f7d\u94fe\u63a5\uff0c\u5f00\u59cb\u4e0b\u8f7dPython\u5b89\u88c5\u5305\u3002<\/li>\n<\/ol>\n<p><h3>\u4e09\u3001\u4e0b\u8f7d\u5e76\u5b89\u88c5<\/h3>\n<\/p>\n<p><p>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u8fd0\u884c\u5b89\u88c5\u5305\u3002\u5b89\u88c5\u5411\u5bfc\u4f1a\u5f15\u5bfc\u4f60\u5b8c\u6210\u5b89\u88c5\u8fc7\u7a0b\u3002\u6ce8\u610f\uff0c\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u8fd9\u5c06\u6709\u52a9\u4e8e\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u4f7f\u7528Python\u3002\u4ee5\u4e0b\u662f\u5b89\u88c5Python\u7684\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u53cc\u51fb\u8fd0\u884c\u5b89\u88c5\u5305\u3002<\/li>\n<li>\u5728\u5b89\u88c5\u5411\u5bfc\u4e2d\uff0c\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u7136\u540e\u70b9\u51fb\u201cInstall Now\u201d\u6309\u94ae\u3002<\/li>\n<li>\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5b89\u88c5\u8fc7\u7a0b\u3002<\/li>\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165\u201cpython\u201d\u6765\u68c0\u67e5\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002\u5982\u679c\u770b\u5230Python\u7684\u7248\u672c\u4fe1\u606f\u548c\u63d0\u793a\u7b26\u201c&gt;&gt;&gt;\u201d\uff0c\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002<\/li>\n<\/ol>\n<p><h3>\u56db\u3001\u914d\u7f6e\u4e2d\u6587\u73af\u5883<\/h3>\n<\/p>\n<p><p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cPython\u7684\u754c\u9762\u548c\u6587\u6863\u662f\u82f1\u6587\u7684\u3002\u5982\u679c\u9700\u8981\u4e2d\u6587\u754c\u9762\uff0c\u53ef\u4ee5\u4f7f\u7528\u7b2c\u4e09\u65b9\u7684\u4e2d\u6587\u5316\u5305\u6216\u63d2\u4ef6\u3002\u4ee5\u4e0b\u662f\u5b89\u88c5\u548c\u914d\u7f6e\u4e2d\u6587\u5316\u5305\u7684\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\u3002<\/li>\n<li>\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u4e2d\u6587\u5316\u5305\uff1a<code>pip install zhconv<\/code><\/li>\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6839\u636e\u5177\u4f53\u9700\u6c42\u4f7f\u7528\u4e2d\u6587\u5316\u5305\u8fdb\u884c\u914d\u7f6e\u3002<\/li>\n<\/ol>\n<p><h3>\u5b89\u88c5\u7b2c\u4e09\u65b9\u4e2d\u6587\u5316\u5305<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u66f4\u597d\u5730\u4f7f\u7528Python\u4e2d\u6587\u7248\uff0c\u4f60\u53ef\u4ee5\u5b89\u88c5\u4e00\u4e9b\u7b2c\u4e09\u65b9\u4e2d\u6587\u5316\u5305\u3002\u8fd9\u4e9b\u5305\u53ef\u4ee5\u5e2e\u52a9\u4f60\u5c06Python\u7684\u754c\u9762\u548c\u6587\u6863\u8f6c\u6362\u4e3a\u4e2d\u6587\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u4e2d\u6587\u5316\u5305\u53ca\u5176\u5b89\u88c5\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>zhconv<\/strong>\uff1a\u8fd9\u662f\u4e00\u4e2a\u4e2d\u6587\u8f6c\u6362\u5de5\u5177\uff0c\u53ef\u4ee5\u5c06\u7b80\u4f53\u4e2d\u6587\u548c\u7e41\u4f53\u4e2d\u6587\u76f8\u4e92\u8f6c\u6362\u3002<\/p>\n<\/p>\n<ul>\n<li>\u5b89\u88c5\u547d\u4ee4\uff1a<code>pip install zhconv<\/code><\/li>\n<li>\u4f7f\u7528\u65b9\u6cd5\uff1a\u5728Python\u4ee3\u7801\u4e2d\u5f15\u5165<code>zhconv<\/code>\u5e93\uff0c\u5e76\u4f7f\u7528\u5176\u63d0\u4f9b\u7684\u51fd\u6570\u8fdb\u884c\u4e2d\u6587\u8f6c\u6362\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>pandas<\/strong>\uff1a\u8fd9\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6570\u636e\u5206\u6790\u5e93\uff0c\u652f\u6301\u4e2d\u6587\u5b57\u7b26\u5904\u7406\u3002<\/p>\n<\/p>\n<ul>\n<li>\u5b89\u88c5\u547d\u4ee4\uff1a<code>pip install pandas<\/code><\/li>\n<li>\u4f7f\u7528\u65b9\u6cd5\uff1a\u5728Python\u4ee3\u7801\u4e2d\u5f15\u5165<code>pandas<\/code>\u5e93\uff0c\u5e76\u4f7f\u7528\u5176\u63d0\u4f9b\u7684\u6570\u636e\u7ed3\u6784\u548c\u51fd\u6570\u8fdb\u884c\u6570\u636e\u5206\u6790\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>matplotlib<\/strong>\uff1a\u8fd9\u662f\u4e00\u4e2a\u6570\u636e\u53ef\u89c6\u5316\u5e93\uff0c\u652f\u6301\u4e2d\u6587\u5b57\u7b26\u663e\u793a\u3002<\/p>\n<\/p>\n<ul>\n<li>\u5b89\u88c5\u547d\u4ee4\uff1a<code>pip install matplotlib<\/code><\/li>\n<li>\u4f7f\u7528\u65b9\u6cd5\uff1a\u5728Python\u4ee3\u7801\u4e2d\u5f15\u5165<code>matplotlib<\/code>\u5e93\uff0c\u5e76\u4f7f\u7528\u5176\u63d0\u4f9b\u7684\u51fd\u6570\u8fdb\u884c\u6570\u636e\u7ed8\u56fe\u548c\u53ef\u89c6\u5316\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u914d\u7f6e\u4e2d\u6587\u663e\u793a\u73af\u5883<\/h3>\n<\/p>\n<p><p>\u5728\u4f7f\u7528Python\u8fdb\u884c\u6570\u636e\u5206\u6790\u548c\u53ef\u89c6\u5316\u65f6\uff0c\u6709\u65f6\u9700\u8981\u914d\u7f6e\u73af\u5883\u4ee5\u6b63\u786e\u663e\u793a\u4e2d\u6587\u5b57\u7b26\u3002\u4ee5\u4e0b\u662f\u914d\u7f6e\u4e2d\u6587\u663e\u793a\u73af\u5883\u7684\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u914d\u7f6ematplotlib\u4e2d\u6587\u5b57\u4f53<\/strong>\uff1a\u5728\u4f7f\u7528matplotlib\u8fdb\u884c\u6570\u636e\u7ed8\u56fe\u65f6\uff0c\u9700\u8981\u914d\u7f6e\u4e2d\u6587\u5b57\u4f53\u4ee5\u6b63\u786e\u663e\u793a\u4e2d\u6587\u5b57\u7b26\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728Python\u4ee3\u7801\u4e2d\u5f15\u5165matplotlib\u5e93\uff1a<code>import matplotlib.pyplot as plt<\/code><\/li>\n<li>\u8bbe\u7f6e\u4e2d\u6587\u5b57\u4f53\uff1a<code>plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;]<\/code>\uff08\u8fd9\u91cc\u7684SimHei\u662f\u9ed1\u4f53\u5b57\u4f53\uff09<\/li>\n<li>\u7981\u7528\u8d1f\u53f7\u663e\u793a\uff1a<code>plt.rcParams[&#39;axes.unicode_minus&#39;] = False<\/code><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u914d\u7f6epandas\u4e2d\u6587\u663e\u793a<\/strong>\uff1a\u5728\u4f7f\u7528pandas\u8fdb\u884c\u6570\u636e\u5206\u6790\u65f6\uff0c\u786e\u4fdd\u6570\u636e\u6846\u4e2d\u7684\u4e2d\u6587\u5b57\u7b26\u80fd\u591f\u6b63\u786e\u663e\u793a\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728Python\u4ee3\u7801\u4e2d\u5f15\u5165pandas\u5e93\uff1a<code>import pandas as pd<\/code><\/li>\n<li>\u914d\u7f6epandas\u663e\u793a\u9009\u9879\uff1a<code>pd.set_option(&#39;display.unicode.east_asian_width&#39;, True)<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u4f7f\u7528\u4e2d\u6587\u6587\u6863\u548c\u6559\u7a0b<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u66f4\u597d\u5730\u5b66\u4e60\u548c\u4f7f\u7528Python\uff0c\u4f60\u53ef\u4ee5\u53c2\u8003\u4e00\u4e9b\u4e2d\u6587\u6587\u6863\u548c\u6559\u7a0b\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u4e2d\u6587\u6587\u6863\u548c\u6559\u7a0b\u8d44\u6e90\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Python\u5b98\u65b9\u6587\u6863\uff08\u4e2d\u6587\u7248\uff09<\/strong>\uff1aPython\u5b98\u7f51\u63d0\u4f9b\u4e86\u4e2d\u6587\u7248\u7684\u5b98\u65b9\u6587\u6863\uff0c\u6db5\u76d6\u4e86Python\u7684\u57fa\u7840\u77e5\u8bc6\u3001\u6807\u51c6\u5e93\u3001\u6a21\u5757\u548c\u5305\u7684\u4f7f\u7528\u65b9\u6cd5\u7b49\u5185\u5bb9\u3002\u4f60\u53ef\u4ee5\u5728Python\u5b98\u7f51\u4e0a\u627e\u5230\u4e2d\u6587\u7248\u7684\u6587\u6863\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4e2d\u6587\u793e\u533a\u548c\u8bba\u575b<\/strong>\uff1a\u52a0\u5165\u4e00\u4e9b\u4e2d\u6587\u7684Python\u793e\u533a\u548c\u8bba\u575b\uff0c\u53ef\u4ee5\u4e0e\u5176\u4ed6Python\u7231\u597d\u8005\u4ea4\u6d41\u5b66\u4e60\u7ecf\u9a8c\uff0c\u89e3\u51b3\u4f7f\u7528\u4e2d\u9047\u5230\u7684\u95ee\u9898\u3002\u5e38\u89c1\u7684\u4e2d\u6587\u793e\u533a\u548c\u8bba\u575b\u5305\u62ecCSDN\u3001\u77e5\u4e4e\u3001Stack Overflow\uff08\u4e2d\u6587\u533a\uff09\u7b49\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4e2d\u6587\u4e66\u7c4d\u548c\u6559\u7a0b<\/strong>\uff1a\u5e02\u9762\u4e0a\u6709\u8bb8\u591a\u4f18\u79c0\u7684Python\u4e2d\u6587\u4e66\u7c4d\u548c\u6559\u7a0b\uff0c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u7cfb\u7edf\u5730\u5b66\u4e60Python\u7f16\u7a0b\u3002\u4f8b\u5982\uff0c\u300aPython\u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5\u300b\u3001\u300a\u6d41\u7545\u7684Python\u300b\u3001\u300aPython\u6838\u5fc3\u7f16\u7a0b\u300b\u7b49\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u5e38\u89c1\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u5728\u4e0b\u8f7d\u548c\u5b89\u88c5Python\u4e2d\u6587\u7248\u7684\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u53ca\u5176\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5\u5931\u8d25\u6216\u62a5\u9519<\/strong>\uff1a\u5982\u679c\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9047\u5230\u5931\u8d25\u6216\u62a5\u9519\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4ee5\u4e0b\u65b9\u6cd5\u89e3\u51b3\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u786e\u4fdd\u4e0b\u8f7d\u7684\u5b89\u88c5\u5305\u5b8c\u6574\u4e14\u672a\u635f\u574f\u3002\u5982\u679c\u6000\u7591\u5b89\u88c5\u5305\u6709\u95ee\u9898\uff0c\u53ef\u4ee5\u91cd\u65b0\u4e0b\u8f7d\u3002<\/li>\n<li>\u68c0\u67e5\u64cd\u4f5c\u7cfb\u7edf\u662f\u5426\u6ee1\u8db3Python\u7684\u5b89\u88c5\u8981\u6c42\u3002\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c\u8fc7\u4f4e\uff0c\u53ef\u80fd\u9700\u8981\u5347\u7ea7\u64cd\u4f5c\u7cfb\u7edf\u3002<\/li>\n<li>\u5173\u95ed\u6740\u6bd2\u8f6f\u4ef6\u6216\u9632\u706b\u5899\uff0c\u53ef\u80fd\u5b83\u4eec\u4f1a\u963b\u6b62\u5b89\u88c5\u7a0b\u5e8f\u7684\u6b63\u5e38\u8fd0\u884c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u547d\u4ee4\u884c\u4e2d\u65e0\u6cd5\u8bc6\u522bPython\u547d\u4ee4<\/strong>\uff1a\u5982\u679c\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u201cpython\u201d\u547d\u4ee4\u65f6\uff0c\u63d0\u793a\u627e\u4e0d\u5230\u8be5\u547d\u4ee4\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4ee5\u4e0b\u65b9\u6cd5\u89e3\u51b3\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u786e\u4fdd\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u52fe\u9009\u4e86\u201cAdd Python to PATH\u201d\u9009\u9879\u3002\u5982\u679c\u6ca1\u6709\u52fe\u9009\uff0c\u53ef\u4ee5\u624b\u52a8\u5c06Python\u7684\u5b89\u88c5\u76ee\u5f55\u6dfb\u52a0\u5230\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u4e2d\u3002<\/li>\n<li>\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u201cpython3\u201d\u547d\u4ee4\uff0c\u6709\u4e9b\u7cfb\u7edf\u4e2d\u53ef\u80fd\u4f7f\u7528\u201cpython3\u201d\u6765\u8c03\u7528Python 3.x\u7248\u672c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u4e2d\u6587\u5b57\u7b26\u663e\u793a\u4e71\u7801<\/strong>\uff1a\u5982\u679c\u5728\u4f7f\u7528Python\u5904\u7406\u4e2d\u6587\u5b57\u7b26\u65f6\u51fa\u73b0\u4e71\u7801\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4ee5\u4e0b\u65b9\u6cd5\u89e3\u51b3\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u786e\u4fdd\u4f7f\u7528\u7684\u7f16\u7801\u683c\u5f0f\u6b63\u786e\u3002\u5728Python\u4ee3\u7801\u4e2d\u6307\u5b9a\u7f16\u7801\u683c\u5f0f\uff0c\u4f8b\u5982\u4f7f\u7528UTF-8\u7f16\u7801\uff1a<code># -*- coding: utf-8 -*-<\/code><\/li>\n<li>\u914d\u7f6e\u4e2d\u6587\u5b57\u4f53\u3002\u5728\u4f7f\u7528matplotlib\u7ed8\u56fe\u65f6\uff0c\u8bbe\u7f6e\u4e2d\u6587\u5b57\u4f53\u4ee5\u6b63\u786e\u663e\u793a\u4e2d\u6587\u5b57\u7b26\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u987a\u5229\u5730\u4e0b\u8f7d\u3001\u5b89\u88c5\u5e76\u914d\u7f6ePython\u4e2d\u6587\u7248\u3002\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\uff0c\u5982\u679c\u9047\u5230\u95ee\u9898\uff0c\u53ef\u4ee5\u53c2\u8003\u6587\u6863\u3001\u6559\u7a0b\u6216\u793e\u533a\u4e2d\u7684\u8d44\u6e90\u8fdb\u884c\u89e3\u51b3\u3002\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u5e2e\u52a9\u4f60\u987a\u5229\u5b89\u88c5\u548c\u4f7f\u7528Python\u4e2d\u6587\u7248\uff0c\u5f00\u542f\u4f60\u7684Python\u7f16\u7a0b\u4e4b\u65c5\uff01<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u627e\u5230\u9002\u5408\u6211\u7684\u64cd\u4f5c\u7cfb\u7edf\u7684\u4e2d\u6587\u7248Python\u4e0b\u8f7d\u94fe\u63a5\uff1f<\/strong><br \/>\u8981\u627e\u5230\u9002\u5408\u60a8\u64cd\u4f5c\u7cfb\u7edf\u7684\u4e2d\u6587\u7248Python\u4e0b\u8f7d\u94fe\u63a5\uff0c\u60a8\u53ef\u4ee5\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff08python.org\uff09\u5e76\u5bfc\u822a\u5230\u4e0b\u8f7d\u9875\u9762\u3002\u5728\u8fd9\u4e2a\u9875\u9762\u4e0a\uff0c\u60a8\u4f1a\u770b\u5230\u4e0d\u540c\u7248\u672c\u7684Python\u4f9b\u4e0b\u8f7d\u3002\u9009\u62e9\u4e0e\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\uff08\u5982Windows\u3001macOS\u6216Linux\uff09\u76f8\u5339\u914d\u7684\u7248\u672c\uff0c\u5e76\u786e\u4fdd\u9009\u62e9\u4e2d\u6587\u7248\u7684\u5b89\u88c5\u5305\u3002\u5982\u679c\u60a8\u5728\u7f51\u7ad9\u4e0a\u627e\u4e0d\u5230\u4e2d\u6587\u7248\uff0c\u53ef\u4ee5\u8003\u8651\u67e5\u627e\u7b2c\u4e09\u65b9\u7f51\u7ad9\u6216\u793e\u533a\uff0c\u63d0\u4f9b\u4e2d\u6587\u7248\u7684\u5b89\u88c5\u6587\u4ef6\u548c\u8bf4\u660e\u3002<\/p>\n<p><strong>\u4e2d\u6587\u7248Python\u7684\u5b89\u88c5\u8fc7\u7a0b\u662f\u600e\u6837\u7684\uff1f<\/strong><br \/>\u4e0b\u8f7d\u4e2d\u6587\u7248Python\u540e\uff0c\u5b89\u88c5\u8fc7\u7a0b\u901a\u5e38\u975e\u5e38\u7b80\u5355\u3002\u8fd0\u884c\u4e0b\u8f7d\u7684\u5b89\u88c5\u7a0b\u5e8f\uff0c\u60a8\u4f1a\u770b\u5230\u4e00\u4e2a\u5b89\u88c5\u5411\u5bfc\u3002\u60a8\u53ef\u4ee5\u9009\u62e9\u5b89\u88c5\u8def\u5f84\u548c\u4e00\u4e9b\u989d\u5916\u9009\u9879\uff0c\u4f8b\u5982\u6dfb\u52a0Python\u5230\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u4e2d\uff0c\u8fd9\u6837\u5728\u547d\u4ee4\u884c\u4e2d\u5c31\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528Python\u547d\u4ee4\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u8f93\u5165\u201cpython\u201d\u6216\u201cpython3\u201d\u6765\u68c0\u67e5\u662f\u5426\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<p><strong>\u4f7f\u7528\u4e2d\u6587\u7248Python\u65f6\uff0c\u6709\u54ea\u4e9b\u5e38\u89c1\u7684\u5f00\u53d1\u5de5\u5177\u63a8\u8350\uff1f<\/strong><br \/>\u4f7f\u7528\u4e2d\u6587\u7248Python\u65f6\uff0c\u60a8\u53ef\u4ee5\u9009\u62e9\u591a\u79cd\u5f00\u53d1\u5de5\u5177\u3002\u6700\u5e38\u7528\u7684\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u5305\u62ecPyCharm\u3001Visual Studio Code\u548cJupyter Notebook\u7b49\u3002\u8fd9\u4e9b\u5de5\u5177\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\uff0c\u5982\u4ee3\u7801\u9ad8\u4eae\u3001\u8c03\u8bd5\u652f\u6301\u548c\u63d2\u4ef6\u6269\u5c55\u7b49\uff0c\u53ef\u4ee5\u5e2e\u52a9\u60a8\u66f4\u9ad8\u6548\u5730\u8fdb\u884cPython\u5f00\u53d1\u3002\u6b64\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528\u4e2d\u6587\u793e\u533a\u63d0\u4f9b\u7684\u5b66\u4e60\u8d44\u6e90\u548c\u6587\u6863\uff0c\u8fdb\u4e00\u6b65\u63d0\u5347\u60a8\u7684\u7f16\u7a0b\u80fd\u529b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u4e0b\u8f7d\u4e2d\u6587\u7248\u7684Python\uff0c\u4f60\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u64cd\u4f5c\uff1a\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\u3001\u9009\u62e9\u5408\u9002\u7684Python\u7248\u672c\u3001 [&hellip;]","protected":false},"author":3,"featured_media":1168928,"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\/1168922"}],"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=1168922"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1168922\/revisions"}],"predecessor-version":[{"id":1168931,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1168922\/revisions\/1168931"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1168928"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1168922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1168922"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1168922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}