{"id":951812,"date":"2024-12-27T01:12:03","date_gmt":"2024-12-26T17:12:03","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/951812.html"},"modified":"2024-12-27T01:12:05","modified_gmt":"2024-12-26T17:12:05","slug":"python-%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%85%e5%9b%be%e5%bd%a2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/951812.html","title":{"rendered":"python \u5982\u4f55\u5b89\u88c5\u56fe\u5f62"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25085903\/e1ccd391-6e9d-4e65-b7ba-c1e189e18707.webp\" alt=\"python \u5982\u4f55\u5b89\u88c5\u56fe\u5f62\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u5b89\u88c5\u56fe\u5f62\u5e93\u4e3b\u8981\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528pip\u8fdb\u884c\u5b89\u88c5\u3001\u4f7f\u7528Anaconda\u8fdb\u884c\u5b89\u88c5\u3001\u4ece\u6e90\u4ee3\u7801\u8fdb\u884c\u5b89\u88c5\u3001\u4f7f\u7528Python\u5305\u7ba1\u7406\u5668\u8fdb\u884c\u5b89\u88c5\u3002<\/strong>\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u4f1a\u9009\u62e9\u4f7f\u7528pip\u8fdb\u884c\u5b89\u88c5\uff0c\u56e0\u4e3a\u5b83\u7b80\u5355\u5feb\u6377\uff0c\u9002\u5408\u5927\u90e8\u5206\u60c5\u51b5\u3002\u901a\u8fc7pip\u5b89\u88c5\uff0c\u53ef\u4ee5\u786e\u4fdd\u5e93\u662f\u6700\u65b0\u7248\u672c\uff0c\u5e76\u4e14\u53ef\u4ee5\u8f7b\u677e\u7ba1\u7406\u4f9d\u8d56\u5173\u7cfb\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u4ecb\u7ecdpip\u5b89\u88c5\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u786e\u4fdd\u4f60\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u548cpip\u3002\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python --version<\/code>\u548c<code>pip --version<\/code>\u6765\u9a8c\u8bc1\u3002\u5982\u679c\u5c1a\u672a\u5b89\u88c5Python\uff0c\u53ef\u4ee5\u4ecePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5b89\u88c5\u5305\uff0c\u5e76\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9009\u62e9\u6dfb\u52a0pip\u5230\u7cfb\u7edf\u8def\u5f84\u3002<\/p>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5\u56fe\u5f62\u5e93\uff08\u4f8b\u5982matplotlib\uff09\uff1a<\/p>\n<\/p>\n<p><pre><code>pip install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e00\u547d\u4ee4\u4f1a\u81ea\u52a8\u4e0b\u8f7d\u5e76\u5b89\u88c5matplotlib\u53ca\u5176\u6240\u9700\u7684\u6240\u6709\u4f9d\u8d56\u5305\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001PIP\u5b89\u88c5\u56fe\u5f62\u5e93<\/h3>\n<\/p>\n<p><p>pip\u662fPython\u5305\u7ba1\u7406\u5668\uff0c\u51e0\u4e4e\u9002\u7528\u4e8e\u6240\u6709\u7684Python\u5305\u5b89\u88c5\u3002\u901a\u8fc7pip\uff0c\u7528\u6237\u53ef\u4ee5\u8f7b\u677e\u5730\u5728Python\u73af\u5883\u4e2d\u5b89\u88c5\u3001\u66f4\u65b0\u3001\u5378\u8f7d\u5404\u79cd\u5e93\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u786e\u4fdd\u5df2\u5b89\u88c5pip<\/h4>\n<\/p>\n<p><p>\u5728\u5b89\u88c5\u5e93\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u4f60\u7684\u7cfb\u7edf\u4e2d\u5df2\u7ecf\u5b89\u88c5\u4e86pip\u3002\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u5b89\u88c5Python\u65f6\u4f1a\u81ea\u52a8\u5b89\u88c5pip\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u68c0\u67e5pip\u662f\u5426\u5df2\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u7cfb\u7edf\u63d0\u793a\u627e\u4e0d\u5230pip\u547d\u4ee4\uff0c\u5219\u9700\u8981\u624b\u52a8\u5b89\u88c5pip\u3002\u53ef\u4ee5\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684Python\uff0c\u5176\u4e2d\u5305\u542bpip\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u4f7f\u7528pip\u5b89\u88c5\u56fe\u5f62\u5e93<\/h4>\n<\/p>\n<p><p>\u4e00\u65e6\u786e\u8ba4pip\u5df2\u5b89\u88c5\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u56fe\u5f62\u5e93\u3002\u8fd9\u91cc\u4ee5\u5b89\u88c5matplotlib\u4e3a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u5b89\u88c5\u5176\u4ed6\u56fe\u5f62\u5e93\uff0c\u6bd4\u5982seaborn\u6216plotly\uff0c\u53ea\u9700\u5c06\u547d\u4ee4\u4e2d\u7684\u5e93\u540d\u66ff\u6362\u5373\u53ef\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install seaborn<\/p>\n<p>pip install plotly<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>pip\u4f1a\u81ea\u52a8\u5904\u7406\u5e93\u7684\u4f9d\u8d56\u5173\u7cfb\uff0c\u786e\u4fdd\u5b89\u88c5\u7684\u5e93\u80fd\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n<\/p>\n<p><h4>3\u3001\u5347\u7ea7\u56fe\u5f62\u5e93<\/h4>\n<\/p>\n<p><p>\u968f\u7740\u65f6\u95f4\u7684\u63a8\u79fb\uff0c\u56fe\u5f62\u5e93\u53ef\u80fd\u4f1a\u53d1\u5e03\u65b0\u7684\u7248\u672c\u3002\u4e3a\u4e86\u786e\u4fdd\u4f7f\u7528\u6700\u65b0\u7684\u529f\u80fd\u548c\u4fee\u590d\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5347\u7ea7\u5df2\u5b89\u88c5\u7684\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install --upgrade matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u540c\u6837\u7684\uff0c\u66ff\u6362\u5e93\u540d\u5373\u53ef\u5347\u7ea7\u5176\u4ed6\u5e93\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528Anaconda\u8fdb\u884c\u5b89\u88c5<\/h3>\n<\/p>\n<p><p>Anaconda\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u6570\u636e\u79d1\u5b66\u5e73\u53f0\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5f3a\u5927\u7684\u5305\u7ba1\u7406\u5668conda\uff0c\u5b83\u80fd\u6709\u6548\u5730\u7ba1\u7406\u548c\u5b89\u88c5Python\u5e93\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5Anaconda<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u4eceAnaconda\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5Anaconda\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7Anaconda Navigator\u6216\u547d\u4ee4\u884c\u4f7f\u7528conda\u6765\u7ba1\u7406\u5305\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u4f7f\u7528conda\u5b89\u88c5\u56fe\u5f62\u5e93<\/h4>\n<\/p>\n<p><p>\u6253\u5f00\u547d\u4ee4\u884c\u6216Anaconda Prompt\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5\u6240\u9700\u7684\u56fe\u5f62\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u5b89\u88c5\u5176\u4ed6\u56fe\u5f62\u5e93\uff0c\u53ea\u9700\u66ff\u6362\u547d\u4ee4\u4e2d\u7684\u5e93\u540d\u5373\u53ef\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda install seaborn<\/p>\n<p>conda install plotly<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>conda\u4f1a\u81ea\u52a8\u5904\u7406\u6240\u6709\u4f9d\u8d56\uff0c\u786e\u4fdd\u5e93\u80fd\u6b63\u786e\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p><h4>3\u3001\u521b\u5efa\u865a\u62df\u73af\u5883\u5e76\u5b89\u88c5\u5e93<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528Anaconda\uff0c\u53ef\u4ee5\u521b\u5efa\u865a\u62df\u73af\u5883\u6765\u9694\u79bb\u4e0d\u540c\u9879\u76ee\u7684\u5e93\u4f9d\u8d56\u3002\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u5e76\u6fc0\u6d3b\u4e00\u4e2a\u65b0\u7684\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda create --name myenv<\/p>\n<p>conda activate myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u6fc0\u6d3b\u7684\u73af\u5883\u4e2d\uff0c\u4f7f\u7528conda\u5b89\u88c5\u6240\u9700\u7684\u56fe\u5f62\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f7f\u7528\u865a\u62df\u73af\u5883\u53ef\u4ee5\u907f\u514d\u5e93\u7248\u672c\u51b2\u7a81\uff0c\u786e\u4fdd\u9879\u76ee\u7684\u7a33\u5b9a\u6027\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4ece\u6e90\u4ee3\u7801\u8fdb\u884c\u5b89\u88c5<\/h3>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u4ece\u6e90\u4ee3\u7801\u5b89\u88c5\u56fe\u5f62\u5e93\uff0c\u4f8b\u5982\u9700\u8981\u5b89\u88c5\u4e00\u4e2a\u7279\u5b9a\u7248\u672c\uff0c\u6216\u8005\u5e93\u7684\u6700\u65b0\u529f\u80fd\u5c1a\u672a\u53d1\u5e03\u5230pip\u6216conda\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u4e0b\u8f7d\u6e90\u4ee3\u7801<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u4ece\u5e93\u7684\u5b98\u65b9\u7f51\u7ad9\u6216GitHub\u4ed3\u5e93\u4e0b\u8f7d\u6e90\u4ee3\u7801\u3002\u901a\u5e38\uff0c\u8fd9\u4e9b\u4ee3\u7801\u4ee5.zip\u6216.tar.gz\u683c\u5f0f\u63d0\u4f9b\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u89e3\u538b\u5e76\u5b89\u88c5<\/h4>\n<\/p>\n<p><p>\u89e3\u538b\u4e0b\u8f7d\u7684\u6587\u4ef6\uff0c\u5e76\u8fdb\u5165\u89e3\u538b\u540e\u7684\u76ee\u5f55\u3002\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python setup.py install<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e00\u8fc7\u7a0b\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u65f6\u95f4\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u5e93\u7684\u5927\u5c0f\u548c\u4f9d\u8d56\u5173\u7cfb\u3002<\/p>\n<\/p>\n<p><h4>3\u3001\u9a8c\u8bc1\u5b89\u88c5<\/h4>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7import\u5e93\u540d\u6765\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002\u4f8b\u5982\uff0c\u9a8c\u8bc1matplotlib\u7684\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u6ca1\u6709\u9519\u8bef\u63d0\u793a\uff0c\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528Python\u5305\u7ba1\u7406\u5668\u8fdb\u884c\u5b89\u88c5<\/h3>\n<\/p>\n<p><p>\u9664\u4e86pip\u548cconda\uff0c\u8fd8\u6709\u5176\u4ed6\u7684\u4e00\u4e9bPython\u5305\u7ba1\u7406\u5668\u53ef\u4ee5\u7528\u6765\u5b89\u88c5\u56fe\u5f62\u5e93\uff0c\u4f8b\u5982poetry\u548cpipenv\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u4f7f\u7528Poetry<\/h4>\n<\/p>\n<p><p>Poetry\u662f\u4e00\u79cd\u73b0\u4ee3\u7684Python\u5305\u7ba1\u7406\u5668\uff0c\u63d0\u4f9b\u4e86\u7b80\u5355\u7684\u4f9d\u8d56\u7ba1\u7406\u548c\u6253\u5305\u529f\u80fd\u3002\u9996\u5148\uff0c\u9700\u8981\u901a\u8fc7pip\u5b89\u88c5Poetry\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install poetry<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u56fe\u5f62\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">poetry add matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>Poetry\u4f1a\u81ea\u52a8\u66f4\u65b0\u9879\u76ee\u7684\u4f9d\u8d56\u6587\u4ef6\uff0c\u5e76\u5b89\u88c5\u6240\u9700\u7684\u5e93\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u4f7f\u7528Pipenv<\/h4>\n<\/p>\n<p><p>Pipenv\u662f\u53e6\u4e00\u4e2a\u6d41\u884c\u7684Python\u5305\u7ba1\u7406\u5668\uff0c\u63d0\u4f9b\u4e86\u865a\u62df\u73af\u5883\u7ba1\u7406\u548c\u4f9d\u8d56\u7ba1\u7406\u529f\u80fd\u3002\u9996\u5148\uff0c\u901a\u8fc7pip\u5b89\u88c5Pipenv\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pipenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u5728\u9879\u76ee\u76ee\u5f55\u4e2d\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u865a\u62df\u73af\u5883\u5e76\u5b89\u88c5\u56fe\u5f62\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pipenv install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>Pipenv\u4f1a\u81ea\u52a8\u521b\u5efa\u4e00\u4e2a\u865a\u62df\u73af\u5883\uff0c\u5e76\u5c06\u5e93\u5b89\u88c5\u5230\u5176\u4e2d\u3002<\/p>\n<\/p>\n<p><h4>3\u3001\u7ba1\u7406\u9879\u76ee\u7684\u4f9d\u8d56<\/h4>\n<\/p>\n<p><p>\u65e0\u8bba\u4f7f\u7528Poetry\u8fd8\u662fPipenv\uff0c\u7ba1\u7406\u9879\u76ee\u7684\u4f9d\u8d56\u90fd\u53d8\u5f97\u66f4\u52a0\u5bb9\u6613\u3002\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u4f9d\u8d56\u6587\u4ef6\u6765\u66f4\u65b0\u5e93\u7248\u672c\uff0c\u6216\u4f7f\u7528\u547d\u4ee4\u884c\u547d\u4ee4\u6765\u5347\u7ea7\u5e93\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u89e3\u51b3\u5b89\u88c5\u95ee\u9898<\/h3>\n<\/p>\n<p><p>\u5728\u5b89\u88c5\u56fe\u5f62\u5e93\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u95ee\u9898\uff0c\u6bd4\u5982\u7f51\u7edc\u95ee\u9898\u3001\u6743\u9650\u4e0d\u8db3\u3001\u7248\u672c\u51b2\u7a81\u7b49\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u7f51\u7edc\u95ee\u9898<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u4e0b\u8f7d\u5e93\u65f6\u9047\u5230\u7f51\u7edc\u95ee\u9898\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u66f4\u6362\u955c\u50cf\u6e90\u3002\u4f8b\u5982\uff0c\u5c06pip\u7684\u6e90\u66f4\u6362\u4e3a\u56fd\u5185\u7684\u955c\u50cf\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install matplotlib -i https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u6743\u9650\u4e0d\u8db3<\/h4>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0c\u5b89\u88c5\u5e93\u53ef\u80fd\u9700\u8981\u7ba1\u7406\u5458\u6743\u9650\u3002\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u524d\u52a0\u4e0a<code>sudo<\/code>\u6765\u89e3\u51b3\u8fd9\u4e00\u95ee\u9898\uff08\u9002\u7528\u4e8eLinux\u548cmacOS\uff09\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo pip install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u7248\u672c\u51b2\u7a81<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u5b89\u88c5\u5e93\u65f6\u9047\u5230\u7248\u672c\u51b2\u7a81\u7684\u95ee\u9898\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u5347\u7ea7pip\u6216conda\uff0c\u6216\u4f7f\u7528\u865a\u62df\u73af\u5883\u6765\u9694\u79bb\u4e0d\u540c\u9879\u76ee\u7684\u4f9d\u8d56\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install --upgrade pip<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f7f\u7528conda\u65f6\uff0c\u53ef\u4ee5\u66f4\u65b0conda\u672c\u8eab\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda update conda<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u9075\u5faa\u4ee5\u4e0a\u6b65\u9aa4\u548c\u6307\u5357\uff0c\u60a8\u53ef\u4ee5\u987a\u5229\u5b89\u88c5\u6240\u9700\u7684Python\u56fe\u5f62\u5e93\uff0c\u5e76\u5728\u9879\u76ee\u4e2d\u4f7f\u7528\u8fd9\u4e9b\u5e93\u8fdb\u884c\u6570\u636e\u53ef\u89c6\u5316\u548c\u5206\u6790\u3002\u65e0\u8bba\u662f\u4f7f\u7528pip\u3001conda\u8fd8\u662f\u5176\u4ed6\u5305\u7ba1\u7406\u5668\uff0c\u90fd\u80fd\u4e3a\u60a8\u63d0\u4f9b\u4fbf\u6377\u7684\u5b89\u88c5\u4f53\u9a8c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5b89\u88c5\u56fe\u5f62\u5e93\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u5b89\u88c5\u56fe\u5f62\u5e93\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7\u5305\u7ba1\u7406\u5de5\u5177pip\u6765\u5b8c\u6210\u3002\u9996\u5148\u786e\u4fdd\u4f60\u7684Python\u73af\u5883\u5df2\u7ecf\u914d\u7f6e\u597d\u3002\u63a5\u4e0b\u6765\uff0c\u53ef\u4ee5\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165\u547d\u4ee4\uff0c\u6bd4\u5982<code>pip install matplotlib<\/code>\u6765\u5b89\u88c5\u5e38\u7528\u7684\u56fe\u5f62\u7ed8\u5236\u5e93Matplotlib\u3002\u6b64\u5916\uff0c\u5176\u4ed6\u5e93\u5982Seaborn\u548cPlotly\u4e5f\u53ef\u4ee5\u901a\u8fc7\u7c7b\u4f3c\u7684\u65b9\u5f0f\u5b89\u88c5\uff0c\u547d\u4ee4\u5206\u522b\u4e3a<code>pip install seaborn<\/code>\u548c<code>pip install plotly<\/code>\u3002<\/p>\n<p><strong>\u5b89\u88c5\u56fe\u5f62\u5e93\u540e\uff0c\u5982\u4f55\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\uff1f<\/strong><br \/>\u5b89\u88c5\u5b8c\u56fe\u5f62\u5e93\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728Python\u73af\u5883\u4e2d\u5bfc\u5165\u5e93\u6765\u68c0\u67e5\u662f\u5426\u6210\u529f\u3002\u6253\u5f00Python\u89e3\u91ca\u5668\u6216Jupyter Notebook\uff0c\u8f93\u5165<code>import matplotlib<\/code>\u3001<code>import seaborn<\/code>\u6216<code>import plotly<\/code>\u7b49\u547d\u4ee4\u3002\u5982\u679c\u6ca1\u6709\u9519\u8bef\u63d0\u793a\uff0c\u8bf4\u660e\u5e93\u5b89\u88c5\u6210\u529f\u3002\u4f60\u4e5f\u53ef\u4ee5\u5c1d\u8bd5\u7ed8\u5236\u4e00\u4e2a\u7b80\u5355\u7684\u56fe\u5f62\u6765\u8fdb\u4e00\u6b65\u786e\u8ba4\uff0c\u4f7f\u7528<code>plt.plot([1, 2, 3], [4, 5, 6])<\/code>\u6765\u751f\u6210\u4e00\u5e45\u7b80\u5355\u7684\u6298\u7ebf\u56fe\u3002<\/p>\n<p><strong>\u5728\u5b89\u88c5\u56fe\u5f62\u5e93\u65f6\u53ef\u80fd\u9047\u5230\u54ea\u4e9b\u5e38\u89c1\u95ee\u9898\uff1f<\/strong><br \/>\u5728\u5b89\u88c5\u56fe\u5f62\u5e93\u65f6\uff0c\u7528\u6237\u53ef\u80fd\u4f1a\u9047\u5230\u591a\u4e2a\u95ee\u9898\uff0c\u5305\u62ec\u6743\u9650\u4e0d\u8db3\u3001\u7f51\u7edc\u8fde\u63a5\u95ee\u9898\u6216\u4e0e\u5176\u4ed6\u5e93\u7684\u517c\u5bb9\u6027\u95ee\u9898\u3002\u5982\u679c\u51fa\u73b0\u6743\u9650\u95ee\u9898\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4f7f\u7528\u7ba1\u7406\u5458\u6743\u9650\u8fd0\u884c\u547d\u4ee4\u63d0\u793a\u7b26\u3002\u5bf9\u4e8e\u7f51\u7edc\u95ee\u9898\uff0c\u786e\u4fdd\u7f51\u7edc\u8fde\u63a5\u6b63\u5e38\u5e76\u5c1d\u8bd5\u66f4\u6362\u6e90\uff0c\u4f8b\u5982\u4f7f\u7528\u6e05\u534e\u5927\u5b66\u7684\u955c\u50cf\u6e90\u3002\u5bf9\u4e8e\u5e93\u7684\u517c\u5bb9\u6027\uff0c\u53ef\u4ee5\u67e5\u770b\u5e93\u7684\u5b98\u65b9\u6587\u6863\uff0c\u786e\u4fdd\u6240\u5b89\u88c5\u7684\u5e93\u7248\u672c\u4e0ePython\u7248\u672c\u76f8\u5339\u914d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u5b89\u88c5\u56fe\u5f62\u5e93\u4e3b\u8981\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528pip\u8fdb\u884c\u5b89\u88c5\u3001\u4f7f\u7528Anaconda\u8fdb\u884c\u5b89\u88c5\u3001\u4ece\u6e90\u4ee3\u7801\u8fdb\u884c\u5b89\u88c5\u3001\u4f7f\u7528 [&hellip;]","protected":false},"author":3,"featured_media":951816,"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\/951812"}],"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=951812"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/951812\/revisions"}],"predecessor-version":[{"id":951819,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/951812\/revisions\/951819"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/951816"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=951812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=951812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=951812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}