{"id":1159725,"date":"2025-01-13T18:56:19","date_gmt":"2025-01-13T10:56:19","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1159725.html"},"modified":"2025-01-13T18:56:22","modified_gmt":"2025-01-13T10:56:22","slug":"python%e4%b8%ad%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%85%e5%9b%be%e5%bd%a2%e5%ba%93","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1159725.html","title":{"rendered":"python\u4e2d\u5982\u4f55\u5b89\u88c5\u56fe\u5f62\u5e93"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25201355\/58775854-d3ca-4fa9-8d2c-f21da9bed139.webp\" alt=\"python\u4e2d\u5982\u4f55\u5b89\u88c5\u56fe\u5f62\u5e93\" \/><\/p>\n<p><p> <strong>Python\u4e2d\u5b89\u88c5\u56fe\u5f62\u5e93\u7684\u65b9\u6cd5\u6709\u5f88\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528pip\u547d\u4ee4\u3001\u4f7f\u7528Anaconda\u7b49\u3002pip\u662f\u6700\u5e38\u7528\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7\u547d\u4ee4\u884c\u5b89\u88c5\u3002<\/strong><\/p>\n<\/p>\n<p><p><strong>pip\u547d\u4ee4<\/strong>\uff1a\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528pip\u547d\u4ee4\uff0cpip\u662fPython\u7684\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u76f4\u63a5\u5b89\u88c5\u5404\u79cd\u56fe\u5f62\u5e93\u3002<\/p>\n<p><strong>Anaconda<\/strong>\uff1aAnaconda\u662f\u4e00\u79cd\u5e38\u89c1\u7684Python\u53d1\u884c\u7248\uff0c\u9002\u7528\u4e8e\u79d1\u5b66\u8ba1\u7b97\u548c\u6570\u636e\u5206\u6790\uff0c\u5185\u7f6e\u4e86\u5f88\u591a\u5e38\u7528\u7684\u5e93\uff0c\u4e5f\u53ef\u4ee5\u65b9\u4fbf\u5730\u5b89\u88c5\u56fe\u5f62\u5e93\u3002<\/p>\n<p><strong>\u6e90\u7801\u5b89\u88c5<\/strong>\uff1a\u4e00\u4e9b\u56fe\u5f62\u5e93\u53ef\u4ee5\u901a\u8fc7\u4e0b\u8f7d\u6e90\u7801\u5305\uff0c\u7136\u540e\u624b\u52a8\u7f16\u8bd1\u548c\u5b89\u88c5\u3002<\/p>\n<p><strong>\u4f7f\u7528Python\u7684\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/strong>\uff1a\u5f88\u591aIDE\u4e5f\u63d0\u4f9b\u4e86\u5b89\u88c5\u56fe\u5f62\u5e93\u7684\u529f\u80fd\uff0c\u6bd4\u5982PyCharm\u7b49\u3002<\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528pip\u547d\u4ee4\u5b89\u88c5\u56fe\u5f62\u5e93<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528pip\u547d\u4ee4\u5b89\u88c5\u662f\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u3002\u4e0b\u9762\u4ee5\u5b89\u88c5matplotlib\u5e93\u4e3a\u4f8b\uff0c\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528pip\u547d\u4ee4\u5b89\u88c5\u56fe\u5f62\u5e93\u3002<\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6253\u5f00\u547d\u4ee4\u884c\uff08Windows\u7528\u6237\u53ef\u4ee5\u4f7f\u7528cmd\uff0cMac\u548cLinux\u7528\u6237\u53ef\u4ee5\u4f7f\u7528\u7ec8\u7aef\uff09\u3002\u7136\u540e\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6309\u4e0b\u56de\u8f66\u952e\u540e\uff0cpip\u5c06\u81ea\u52a8\u4e0b\u8f7d\u5e76\u5b89\u88c5matplotlib\u5e93\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728Python\u4e2d\u5bfc\u5165\u5e76\u4f7f\u7528\u8be5\u5e93\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u4f7f\u7528matplotlib\u7ed8\u5236\u4e00\u6761\u7b80\u5355\u7684\u6298\u7ebf\u56fe\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u6570\u636e<\/strong><\/h2>\n<p>x = [1, 2, 3, 4, 5]<\/p>\n<p>y = [2, 3, 5, 7, 11]<\/p>\n<h2><strong>\u7ed8\u5236\u6298\u7ebf\u56fe<\/strong><\/h2>\n<p>plt.plot(x, y)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u5f62<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u4e00\u3001\u4f7f\u7528pip\u5b89\u88c5\u5e38\u89c1\u7684\u56fe\u5f62\u5e93<\/h2>\n<\/p>\n<p><h3>1. Matplotlib<\/h3>\n<\/p>\n<p><p>Matplotlib\u662fPython\u4e2d\u6700\u5e38\u7528\u7684\u7ed8\u56fe\u5e93\u4e4b\u4e00\uff0c\u9002\u7528\u4e8e\u5404\u79cd\u6570\u636e\u53ef\u89c6\u5316\u4efb\u52a1\u3002\u4f7f\u7528pip\u5b89\u88c5Matplotlib\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728Python\u4e2d\u5bfc\u5165\u5e76\u4f7f\u7528Matplotlib\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u4f7f\u7528Matplotlib\u7ed8\u5236\u4e00\u6761\u7b80\u5355\u7684\u6298\u7ebf\u56fe\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u6570\u636e<\/strong><\/h2>\n<p>x = [1, 2, 3, 4, 5]<\/p>\n<p>y = [2, 3, 5, 7, 11]<\/p>\n<h2><strong>\u7ed8\u5236\u6298\u7ebf\u56fe<\/strong><\/h2>\n<p>plt.plot(x, y)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u5f62<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2. Seaborn<\/h3>\n<\/p>\n<p><p>Seaborn\u662f\u57fa\u4e8eMatplotlib\u7684\u53e6\u4e00\u4e2a\u5f3a\u5927\u7684\u7ed8\u56fe\u5e93\uff0c\u4e13\u6ce8\u4e8e\u7edf\u8ba1\u6570\u636e\u7684\u53ef\u89c6\u5316\u3002\u4f7f\u7528pip\u5b89\u88c5Seaborn\u540c\u6837\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install seaborn<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728Python\u4e2d\u5bfc\u5165\u5e76\u4f7f\u7528Seaborn\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u4f7f\u7528Seaborn\u7ed8\u5236\u4e00\u4e2a\u6563\u70b9\u56fe\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import seaborn as sns<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u6570\u636e<\/strong><\/h2>\n<p>tips = sns.load_dataset(&quot;tips&quot;)<\/p>\n<h2><strong>\u7ed8\u5236\u6563\u70b9\u56fe<\/strong><\/h2>\n<p>sns.scatterplot(x=&quot;total_bill&quot;, y=&quot;tip&quot;, data=tips)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u5f62<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3. Plotly<\/h3>\n<\/p>\n<p><p>Plotly\u662f\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u7684\u7ed8\u56fe\u5e93\uff0c\u9002\u7528\u4e8e\u751f\u6210\u9ad8\u8d28\u91cf\u7684\u56fe\u5f62\uff0c\u7279\u522b\u662f\u9002\u7528\u4e8eWeb\u5e94\u7528\u3002\u4f7f\u7528pip\u5b89\u88c5Plotly\u540c\u6837\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install plotly<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728Python\u4e2d\u5bfc\u5165\u5e76\u4f7f\u7528Plotly\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u4f7f\u7528Plotly\u7ed8\u5236\u4e00\u4e2a\u67f1\u72b6\u56fe\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import plotly.express as px<\/p>\n<h2><strong>\u6570\u636e<\/strong><\/h2>\n<p>df = px.data.tips()<\/p>\n<h2><strong>\u7ed8\u5236\u67f1\u72b6\u56fe<\/strong><\/h2>\n<p>fig = px.bar(df, x=&quot;sex&quot;, y=&quot;total_bill&quot;, color=&quot;sex&quot;, barmode=&quot;group&quot;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u5f62<\/strong><\/h2>\n<p>fig.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u4e8c\u3001\u4f7f\u7528Anaconda\u5b89\u88c5\u56fe\u5f62\u5e93<\/h2>\n<\/p>\n<p><p>Anaconda\u662f\u4e00\u4e2a\u9002\u7528\u4e8e\u79d1\u5b66\u8ba1\u7b97\u548c\u6570\u636e\u5206\u6790\u7684Python\u53d1\u884c\u7248\uff0c\u5185\u7f6e\u4e86\u5f88\u591a\u5e38\u7528\u7684\u5e93\uff0c\u4e5f\u53ef\u4ee5\u65b9\u4fbf\u5730\u5b89\u88c5\u56fe\u5f62\u5e93\u3002\u4f7f\u7528Anaconda\u5b89\u88c5\u56fe\u5f62\u5e93\u7684\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><h3>1. \u5b89\u88c5Anaconda<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u4e0b\u8f7d\u5e76\u5b89\u88c5Anaconda\u3002\u53ef\u4ee5\u4eceAnaconda\u7684\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.anaconda.com\/products\/individual%EF%BC%89%E4%B8%8B%E8%BD%BD%E9%80%82%E7%94%A8%E4%BA%8E%E8%87%AA%E5%B7%B1%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E7%9A%84%E5%AE%89%E8%A3%85%E5%8C%85%EF%BC%8C%E7%84%B6%E5%90%8E%E6%8C%89%E7%85%A7%E6%8F%90%E7%A4%BA%E8%BF%9B%E8%A1%8C%E5%AE%89%E8%A3%85%E3%80%82\">https:\/\/www.anaconda.com\/products\/individual\uff09\u4e0b\u8f7d\u9002\u7528\u4e8e\u81ea\u5df1\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\uff0c\u7136\u540e\u6309\u7167\u63d0\u793a\u8fdb\u884c\u5b89\u88c5\u3002<\/a><\/p>\n<\/p>\n<p><h3>2. \u521b\u5efa\u865a\u62df\u73af\u5883<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u907f\u514d\u5e93\u4e4b\u95f4\u7684\u51b2\u7a81\uff0c\u5efa\u8bae\u5728\u865a\u62df\u73af\u5883\u4e2d\u5b89\u88c5\u56fe\u5f62\u5e93\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda create -n myenv python=3.8<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5176\u4e2d<code>myenv<\/code>\u662f\u865a\u62df\u73af\u5883\u7684\u540d\u79f0\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u8981\u81ea\u884c\u4fee\u6539\uff0c<code>python=3.8<\/code>\u8868\u793a\u4f7f\u7528Python 3.8\u7248\u672c\u3002<\/p>\n<\/p>\n<p><h3>3. \u6fc0\u6d3b\u865a\u62df\u73af\u5883<\/h3>\n<\/p>\n<p><p>\u521b\u5efa\u865a\u62df\u73af\u5883\u540e\uff0c\u9700\u8981\u6fc0\u6d3b\u5b83\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6fc0\u6d3b\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda activate myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>4. \u5b89\u88c5\u56fe\u5f62\u5e93<\/h3>\n<\/p>\n<p><p>\u6fc0\u6d3b\u865a\u62df\u73af\u5883\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528conda\u547d\u4ee4\u5b89\u88c5\u5404\u79cd\u56fe\u5f62\u5e93\u3002\u4f8b\u5982\uff0c\u5b89\u88c5Matplotlib\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728Python\u4e2d\u5bfc\u5165\u5e76\u4f7f\u7528Matplotlib\uff0c\u793a\u4f8b\u5982\u524d\u6587\u6240\u8ff0\u3002<\/p>\n<\/p>\n<p><h2>\u4e09\u3001\u6e90\u7801\u5b89\u88c5\u56fe\u5f62\u5e93<\/h2>\n<\/p>\n<p><p>\u6709\u4e9b\u56fe\u5f62\u5e93\u53ef\u80fd\u6ca1\u6709\u53d1\u5e03\u5728PyPI\u6216Anaconda\u4ed3\u5e93\u4e2d\uff0c\u9700\u8981\u4ece\u6e90\u7801\u8fdb\u884c\u5b89\u88c5\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u901a\u7528\u7684\u6e90\u7801\u5b89\u88c5\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><h3>1. \u4e0b\u8f7d\u6e90\u7801<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u4ece\u56fe\u5f62\u5e93\u7684\u5b98\u65b9\u7f51\u7ad9\u6216GitHub\u4ed3\u5e93\u4e0b\u8f7d\u6e90\u7801\u3002\u4ee5matplotlib\u4e3a\u4f8b\uff0c\u53ef\u4ee5\u4ece\u5176GitHub\u4ed3\u5e93\uff08<a href=\"https:\/\/github.com\/matplotlib\/matplotlib%EF%BC%89%E4%B8%8B%E8%BD%BD%E6%9C%80%E6%96%B0%E7%9A%84%E6%BA%90%E7%A0%81%E3%80%82\">https:\/\/github.com\/matplotlib\/matplotlib\uff09\u4e0b\u8f7d\u6700\u65b0\u7684\u6e90\u7801\u3002<\/a><\/p>\n<\/p>\n<p><h3>2. \u89e3\u538b\u6e90\u7801<\/h3>\n<\/p>\n<p><p>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u9700\u8981\u5c06\u6e90\u7801\u5305\u89e3\u538b\u5230\u672c\u5730\u76ee\u5f55\u3002\u4ee5matplotlib\u4e3a\u4f8b\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u89e3\u538b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">tar -xzvf matplotlib-x.y.z.tar.gz<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5176\u4e2d<code>matplotlib-x.y.z.tar.gz<\/code>\u662f\u4e0b\u8f7d\u7684\u6e90\u7801\u5305\u6587\u4ef6\u540d\u3002<\/p>\n<\/p>\n<p><h3>3. \u5b89\u88c5\u4f9d\u8d56<\/h3>\n<\/p>\n<p><p>\u5728\u5b89\u88c5\u56fe\u5f62\u5e93\u4e4b\u524d\uff0c\u901a\u5e38\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u4f9d\u8d56\u5e93\u3002\u53ef\u4ee5\u67e5\u770b\u56fe\u5f62\u5e93\u7684README\u6587\u4ef6\u6216\u6587\u6863\uff0c\u4e86\u89e3\u6240\u9700\u7684\u4f9d\u8d56\u5e93\uff0c\u5e76\u4f7f\u7528pip\u6216conda\u8fdb\u884c\u5b89\u88c5\u3002\u4f8b\u5982\uff0c\u5b89\u88c5matplotlib\u6240\u9700\u7684\u4f9d\u8d56\u5e93\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install numpy<\/p>\n<p>pip install cycler<\/p>\n<p>pip install pyparsing<\/p>\n<p>pip install python-dateutil<\/p>\n<p>pip install kiwisolver<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>4. \u7f16\u8bd1\u5e76\u5b89\u88c5<\/h3>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u4f9d\u8d56\u5e93\u540e\uff0c\u53ef\u4ee5\u7f16\u8bd1\u5e76\u5b89\u88c5\u56fe\u5f62\u5e93\u3002\u4ee5matplotlib\u4e3a\u4f8b\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">cd matplotlib-x.y.z<\/p>\n<p>python setup.py install<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728Python\u4e2d\u5bfc\u5165\u5e76\u4f7f\u7528\u8be5\u56fe\u5f62\u5e93\uff0c\u793a\u4f8b\u5982\u524d\u6587\u6240\u8ff0\u3002<\/p>\n<\/p>\n<p><h2>\u56db\u3001\u4f7f\u7528Python\u7684\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u5b89\u88c5\u56fe\u5f62\u5e93<\/h2>\n<\/p>\n<p><p>\u5f88\u591aPython\u7684\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u4e5f\u63d0\u4f9b\u4e86\u5b89\u88c5\u56fe\u5f62\u5e93\u7684\u529f\u80fd\u3002\u4f8b\u5982\uff0cPyCharm\u662f\u4e00\u4e2a\u6d41\u884c\u7684Python IDE\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u5b89\u88c5\u5404\u79cd\u56fe\u5f62\u5e93\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528PyCharm\u5b89\u88c5\u56fe\u5f62\u5e93\u7684\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><h3>1. \u5b89\u88c5PyCharm<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u4e0b\u8f7d\u5e76\u5b89\u88c5PyCharm\u3002\u53ef\u4ee5\u4ecePyCharm\u7684\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.jetbrains.com\/pycharm\/download\/%EF%BC%89%E4%B8%8B%E8%BD%BD%E9%80%82%E7%94%A8%E4%BA%8E%E8%87%AA%E5%B7%B1%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E7%9A%84%E5%AE%89%E8%A3%85%E5%8C%85%EF%BC%8C%E7%84%B6%E5%90%8E%E6%8C%89%E7%85%A7%E6%8F%90%E7%A4%BA%E8%BF%9B%E8%A1%8C%E5%AE%89%E8%A3%85%E3%80%82\">https:\/\/www.jetbr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>ns.com\/pycharm\/download\/\uff09\u4e0b\u8f7d\u9002\u7528\u4e8e\u81ea\u5df1\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\uff0c\u7136\u540e\u6309\u7167\u63d0\u793a\u8fdb\u884c\u5b89\u88c5\u3002<\/a><\/p>\n<\/p>\n<p><h3>2. \u521b\u5efa\u9879\u76ee<\/h3>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u542f\u52a8PyCharm\u5e76\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\u3002\u5728\u521b\u5efa\u9879\u76ee\u65f6\uff0c\u53ef\u4ee5\u9009\u62e9\u4f7f\u7528\u73b0\u6709\u7684Python\u89e3\u91ca\u5668\u6216\u521b\u5efa\u65b0\u7684\u865a\u62df\u73af\u5883\u3002<\/p>\n<\/p>\n<p><h3>3. \u5b89\u88c5\u56fe\u5f62\u5e93<\/h3>\n<\/p>\n<p><p>\u521b\u5efa\u9879\u76ee\u540e\uff0c\u53ef\u4ee5\u5728PyCharm\u7684\u201c\u9879\u76ee\u89e3\u91ca\u5668\u201d\u8bbe\u7f6e\u4e2d\u5b89\u88c5\u56fe\u5f62\u5e93\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u6253\u5f00\u201c\u6587\u4ef6\u201d\u83dc\u5355\uff0c\u9009\u62e9\u201c\u8bbe\u7f6e\u201d\u3002<\/li>\n<li>\u5728\u8bbe\u7f6e\u7a97\u53e3\u4e2d\uff0c\u9009\u62e9\u201c\u9879\u76ee\uff1a&lt;\u9879\u76ee\u540d\u79f0&gt;\u201d\uff0c\u7136\u540e\u9009\u62e9\u201cPython\u89e3\u91ca\u5668\u201d\u3002<\/li>\n<li>\u5728\u53f3\u4fa7\u7684\u89e3\u91ca\u5668\u5217\u8868\u4e2d\uff0c\u70b9\u51fb\u201c+\u201d\u6309\u94ae\uff0c\u6253\u5f00\u201c\u53ef\u7528\u5305\u201d\u7a97\u53e3\u3002<\/li>\n<li>\u5728\u201c\u53ef\u7528\u5305\u201d\u7a97\u53e3\u4e2d\uff0c\u8f93\u5165\u8981\u5b89\u88c5\u7684\u56fe\u5f62\u5e93\u540d\u79f0\uff0c\u4f8b\u5982\u201cmatplotlib\u201d\u3002<\/li>\n<li>\u9009\u62e9\u56fe\u5f62\u5e93\uff0c\u5e76\u70b9\u51fb\u201c\u5b89\u88c5\u5305\u201d\u6309\u94ae\u3002<\/li>\n<\/ol>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728Python\u4e2d\u5bfc\u5165\u5e76\u4f7f\u7528\u8be5\u56fe\u5f62\u5e93\uff0c\u793a\u4f8b\u5982\u524d\u6587\u6240\u8ff0\u3002<\/p>\n<\/p>\n<p><h2>\u4e94\u3001\u5e38\u89c1\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6cd5<\/h2>\n<\/p>\n<p><p>\u5728\u5b89\u88c5\u56fe\u5f62\u5e93\u7684\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u53ca\u5176\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><h3>1. \u5b89\u88c5\u5931\u8d25<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u5728\u5b89\u88c5\u56fe\u5f62\u5e93\u65f6\u9047\u5230\u5b89\u88c5\u5931\u8d25\u7684\u60c5\u51b5\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4ee5\u4e0b\u65b9\u6cd5\u89e3\u51b3\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u786e\u4fdd\u7f51\u7edc\u8fde\u63a5\u6b63\u5e38\uff0c\u907f\u514d\u7531\u4e8e\u7f51\u7edc\u95ee\u9898\u5bfc\u81f4\u5b89\u88c5\u5931\u8d25\u3002<\/li>\n<li>\u66f4\u65b0pip\u6216conda\u5230\u6700\u65b0\u7248\u672c\uff0c\u786e\u4fdd\u5305\u7ba1\u7406\u5de5\u5177\u7684\u7a33\u5b9a\u6027\u3002<\/li>\n<li>\u68c0\u67e5\u4f9d\u8d56\u5e93\u662f\u5426\u5b89\u88c5\u5b8c\u6574\uff0c\u5e76\u6839\u636e\u63d0\u793a\u5b89\u88c5\u7f3a\u5931\u7684\u4f9d\u8d56\u5e93\u3002<\/li>\n<\/ol>\n<p><h3>2. \u7248\u672c\u51b2\u7a81<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u5728\u5b89\u88c5\u56fe\u5f62\u5e93\u65f6\u9047\u5230\u7248\u672c\u51b2\u7a81\u7684\u95ee\u9898\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4ee5\u4e0b\u65b9\u6cd5\u89e3\u51b3\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u521b\u5efa\u865a\u62df\u73af\u5883\uff0c\u5e76\u5728\u865a\u62df\u73af\u5883\u4e2d\u5b89\u88c5\u56fe\u5f62\u5e93\uff0c\u907f\u514d\u4e0e\u5176\u4ed6\u9879\u76ee\u7684\u5e93\u53d1\u751f\u51b2\u7a81\u3002<\/li>\n<li>\u68c0\u67e5\u56fe\u5f62\u5e93\u7684\u7248\u672c\u8981\u6c42\uff0c\u786e\u4fdd\u5b89\u88c5\u7684\u4f9d\u8d56\u5e93\u7248\u672c\u7b26\u5408\u8981\u6c42\u3002<\/li>\n<\/ol>\n<p><h3>3. \u65e0\u6cd5\u5bfc\u5165<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u5728\u5b89\u88c5\u5b8c\u6210\u540e\u65e0\u6cd5\u5bfc\u5165\u56fe\u5f62\u5e93\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4ee5\u4e0b\u65b9\u6cd5\u89e3\u51b3\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u786e\u4fdd\u56fe\u5f62\u5e93\u5b89\u88c5\u5728\u5f53\u524d\u4f7f\u7528\u7684Python\u73af\u5883\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>pip list<\/code>\u6216<code>conda list<\/code>\u547d\u4ee4\u67e5\u770b\u5df2\u5b89\u88c5\u7684\u5e93\u5217\u8868\u3002<\/li>\n<li>\u68c0\u67e5Python\u73af\u5883\u8def\u5f84\uff0c\u786e\u4fdd\u5bfc\u5165\u7684\u5e93\u8def\u5f84\u6b63\u786e\u3002<\/li>\n<\/ol>\n<p><h3>4. \u56fe\u5f62\u663e\u793a\u95ee\u9898<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u5728\u4f7f\u7528\u56fe\u5f62\u5e93\u65f6\u9047\u5230\u56fe\u5f62\u663e\u793a\u95ee\u9898\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4ee5\u4e0b\u65b9\u6cd5\u89e3\u51b3\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u786e\u4fdd\u5df2\u6b63\u786e\u5b89\u88c5\u56fe\u5f62\u5e93\u7684\u4f9d\u8d56\u5e93\uff0c\u4f8b\u5982Matplotlib\u9700\u8981\u5b89\u88c5<code>tkinter<\/code>\u5e93\u3002<\/li>\n<li>\u68c0\u67e5\u56fe\u5f62\u5e93\u7684\u6587\u6863\u6216\u793a\u4f8b\u4ee3\u7801\uff0c\u786e\u4fdd\u6b63\u786e\u4f7f\u7528\u56fe\u5f62\u5e93\u7684API\u3002<\/li>\n<li>\u68c0\u67e5\u64cd\u4f5c\u7cfb\u7edf\u548cPython\u7248\u672c\u7684\u517c\u5bb9\u6027\uff0c\u786e\u4fdd\u56fe\u5f62\u5e93\u652f\u6301\u5f53\u524d\u7684\u64cd\u4f5c\u7cfb\u7edf\u548cPython\u7248\u672c\u3002<\/li>\n<\/ol>\n<p><h2>\u516d\u3001\u603b\u7ed3<\/h2>\n<\/p>\n<p><p>\u5b89\u88c5Python\u56fe\u5f62\u5e93\u7684\u65b9\u6cd5\u591a\u79cd\u591a\u6837\uff0c\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528pip\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\u3002\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528Anaconda\u3001\u6e90\u7801\u5b89\u88c5\u4ee5\u53ca\u901a\u8fc7\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u5b89\u88c5\u56fe\u5f62\u5e93\u3002\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u95ee\u9898\uff0c\u901a\u8fc7\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5\u3001\u66f4\u65b0\u5305\u7ba1\u7406\u5de5\u5177\u3001\u521b\u5efa\u865a\u62df\u73af\u5883\u4ee5\u53ca\u68c0\u67e5\u4f9d\u8d56\u5e93\u7b49\u65b9\u6cd5\uff0c\u53ef\u4ee5\u89e3\u51b3\u5927\u90e8\u5206\u95ee\u9898\u3002\u5e0c\u671b\u672c\u6587\u80fd\u5e2e\u52a9\u60a8\u987a\u5229\u5b89\u88c5\u5e76\u4f7f\u7528Python\u7684\u56fe\u5f62\u5e93\uff0c\u8fdb\u884c\u6570\u636e\u53ef\u89c6\u5316\u548c\u56fe\u5f62\u7ed8\u5236\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u9009\u62e9\u9002\u5408\u7684Python\u56fe\u5f62\u5e93\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u9009\u62e9\u56fe\u5f62\u5e93\u65f6\u9700\u8981\u8003\u8651\u51e0\u4e2a\u56e0\u7d20\uff0c\u5305\u62ec\u9879\u76ee\u7684\u9700\u6c42\u3001\u5e93\u7684\u529f\u80fd\u3001\u793e\u533a\u652f\u6301\u548c\u6587\u6863\u8d28\u91cf\u3002\u5e38\u89c1\u7684\u56fe\u5f62\u5e93\u6709Matplotlib\u3001Seaborn\u3001Pygame\u548cTkinter\u7b49\u3002\u5982\u679c\u60a8\u9700\u8981\u8fdb\u884c\u6570\u636e\u53ef\u89c6\u5316\uff0cMatplotlib\u548cSeaborn\u662f\u5f88\u597d\u7684\u9009\u62e9\uff1b\u5982\u679c\u662f\u5f00\u53d1\u6e38\u620f\uff0cPygame\u4f1a\u975e\u5e38\u6709\u7528\uff1b\u800cTkinter\u5219\u9002\u5408\u521b\u5efa\u7b80\u5355\u7684\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p><strong>\u5b89\u88c5\u56fe\u5f62\u5e93\u7684\u5e38\u7528\u547d\u4ee4\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u5b89\u88c5Python\u56fe\u5f62\u5e93\u901a\u5e38\u53ef\u4ee5\u4f7f\u7528pip\u547d\u4ee4\u3002\u4f8b\u5982\uff0c\u8981\u5b89\u88c5Matplotlib\uff0c\u53ef\u4ee5\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165<code>pip install matplotlib<\/code>\u3002\u5bf9\u4e8e\u5176\u4ed6\u5e93\uff0c\u5982Seaborn\u6216Pygame\uff0c\u547d\u4ee4\u5206\u522b\u4e3a<code>pip install seaborn<\/code>\u548c<code>pip install pygame<\/code>\u3002\u786e\u4fdd\u5728\u5b89\u88c5\u524d\u60a8\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u548cpip\u5de5\u5177\u3002<\/p>\n<p><strong>\u5728\u5b89\u88c5\u56fe\u5f62\u5e93\u65f6\u53ef\u80fd\u4f1a\u9047\u5230\u54ea\u4e9b\u5e38\u89c1\u95ee\u9898\uff1f<\/strong><br \/>\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u7528\u6237\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u95ee\u9898\uff0c\u4f8b\u5982\u6743\u9650\u4e0d\u8db3\u3001\u7f51\u7edc\u8fde\u63a5\u95ee\u9898\u6216\u4f9d\u8d56\u5173\u7cfb\u7f3a\u5931\u3002\u5982\u679c\u51fa\u73b0\u6743\u9650\u95ee\u9898\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4f7f\u7528\u7ba1\u7406\u5458\u6743\u9650\u6216\u5728Linux\u7cfb\u7edf\u4e2d\u4f7f\u7528<code>sudo<\/code>\u547d\u4ee4\u3002\u5982\u679c\u662f\u7f51\u7edc\u95ee\u9898\uff0c\u8bf7\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5\u6216\u4f7f\u7528VPN\u3002\u5982\u679c\u51fa\u73b0\u4f9d\u8d56\u5173\u7cfb\u7f3a\u5931\uff0c\u786e\u4fdd\u66f4\u65b0pip\u5e76\u5b89\u88c5\u6240\u9700\u7684\u4f9d\u8d56\u9879\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u4e2d\u5b89\u88c5\u56fe\u5f62\u5e93\u7684\u65b9\u6cd5\u6709\u5f88\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528pip\u547d\u4ee4\u3001\u4f7f\u7528Anaconda\u7b49\u3002pip\u662f\u6700\u5e38\u7528\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5 [&hellip;]","protected":false},"author":3,"featured_media":1159740,"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\/1159725"}],"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=1159725"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1159725\/revisions"}],"predecessor-version":[{"id":1159742,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1159725\/revisions\/1159742"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1159740"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1159725"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1159725"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1159725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}