{"id":996725,"date":"2024-12-27T09:17:26","date_gmt":"2024-12-27T01:17:26","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/996725.html"},"modified":"2024-12-27T09:17:29","modified_gmt":"2024-12-27T01:17:29","slug":"anaconda%e5%a6%82%e4%bd%95%e6%b7%bb%e5%8a%a0python%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/996725.html","title":{"rendered":"anaconda\u5982\u4f55\u6dfb\u52a0python\u73af\u5883"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25072839\/ee83478e-64e7-4a89-a133-37e9355b6986.webp\" alt=\"anaconda\u5982\u4f55\u6dfb\u52a0python\u73af\u5883\" \/><\/p>\n<p><p> <strong>Anaconda\u6dfb\u52a0Python\u73af\u5883\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528Anaconda Navigator\u3001\u4f7f\u7528conda\u547d\u4ee4\u884c\u3001\u521b\u5efa\u7279\u5b9aPython\u7248\u672c\u7684\u73af\u5883<\/strong>\u3002\u4ee5\u4e0b\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u901a\u8fc7\u8fd9\u4e9b\u65b9\u6cd5\u6dfb\u52a0Python\u73af\u5883\u7684\u6b65\u9aa4\u53ca\u5176\u6ce8\u610f\u4e8b\u9879\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528Anaconda Navigator<\/p>\n<\/p>\n<p><p>Anaconda Navigator\u662fAnaconda\u63d0\u4f9b\u7684\u56fe\u5f62\u7528\u6237\u754c\u9762\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u7ba1\u7406Python\u73af\u5883\u548c\u5b89\u88c5\u5305\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6253\u5f00Anaconda Navigator<\/strong><br \/>\u9996\u5148\uff0c\u786e\u4fddAnaconda\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\u5728\u7cfb\u7edf\u4e2d\u3002\u6253\u5f00Anaconda Navigator\uff0c\u60a8\u4f1a\u770b\u5230\u4e00\u4e2a\u5e26\u6709\u591a\u4e2a\u9009\u9879\u7684\u4eea\u8868\u76d8\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efa\u65b0\u7684\u73af\u5883<\/strong><br \/>\u5728Anaconda Navigator\u7684\u5de6\u4fa7\u83dc\u5355\u680f\u4e2d\uff0c\u70b9\u51fb\u201cEnvironments\u201d\u3002\u5728\u754c\u9762\u7684\u5e95\u90e8\uff0c\u60a8\u4f1a\u770b\u5230\u4e00\u4e2a\u201cCreate\u201d\u6309\u94ae\u3002\u70b9\u51fb\u5b83\uff0c\u5f39\u51fa\u521b\u5efa\u65b0\u73af\u5883\u7684\u7a97\u53e3\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9009\u62e9Python\u7248\u672c<\/strong><br \/>\u5728\u5f39\u51fa\u7684\u7a97\u53e3\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4e3a\u65b0\u7684\u73af\u5883\u547d\u540d\uff0c\u5e76\u9009\u62e9\u6240\u9700\u7684Python\u7248\u672c\u3002Anaconda\u63d0\u4f9b\u591a\u4e2a\u7248\u672c\u4f9b\u9009\u62e9\uff0c\u60a8\u53ef\u4ee5\u6839\u636e\u9879\u76ee\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6dfb\u52a0\u9700\u8981\u7684\u5305<\/strong><br \/>\u5728\u521b\u5efa\u8fc7\u7a0b\u4e2d\uff0c\u60a8\u53ef\u4ee5\u9009\u62e9\u6027\u5730\u5b89\u88c5\u4e00\u4e9b\u5e38\u7528\u7684Python\u5305\uff0c\u5982numpy\u3001pandas\u7b49\u3002\u521b\u5efa\u5b8c\u6210\u540e\uff0c\u65b0\u7684\u73af\u5883\u5c06\u51fa\u73b0\u5728\u5de6\u4fa7\u83dc\u5355\u4e2d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6fc0\u6d3b\u73af\u5883<\/strong><br \/>\u5728Anaconda Navigator\u4e2d\uff0c\u9009\u62e9\u60a8\u521b\u5efa\u7684\u65b0\u73af\u5883\uff0c\u7136\u540e\u70b9\u51fb\u201cOpen Terminal\u201d\u4ee5\u6fc0\u6d3b\u8be5\u73af\u5883\u3002\u6b64\u65f6\uff0c\u60a8\u53ef\u4ee5\u5728\u7ec8\u7aef\u4e2d\u4f7f\u7528\u65b0\u73af\u5883\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p><strong>\u6ce8\u610f\u4e8b\u9879<\/strong>\uff1a\u4f7f\u7528Anaconda Navigator\u7684\u4f18\u70b9\u662f\u754c\u9762\u53cb\u597d\u3001\u64cd\u4f5c\u76f4\u89c2\uff0c\u9002\u5408\u521d\u5b66\u8005\u3002\u7f3a\u70b9\u662f\u53ef\u80fd\u4f1a\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u8f83\u6162\uff0c\u5c24\u5176\u662f\u5728\u73af\u5883\u8f83\u591a\u7684\u65f6\u5019\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528conda\u547d\u4ee4\u884c<\/p>\n<\/p>\n<p><p>\u5bf9\u4e8e\u559c\u6b22\u547d\u4ee4\u884c\u64cd\u4f5c\u7684\u7528\u6237\uff0c\u4f7f\u7528conda\u547d\u4ee4\u884c\u662f\u4e00\u4e2a\u5feb\u901f\u4e14\u9ad8\u6548\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef<\/strong><br \/>\u5728Windows\u4e0a\uff0c\u60a8\u53ef\u4ee5\u6253\u5f00Anaconda Prompt\uff1b\u5728macOS\u6216Linux\u4e0a\uff0c\u76f4\u63a5\u6253\u5f00\u7ec8\u7aef\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efa\u65b0\u73af\u5883<\/strong><br \/>\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u65b0\u73af\u5883\uff0c\u5e76\u6307\u5b9aPython\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda create --name myenv python=3.8<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u91cc\uff0c<code>myenv<\/code>\u662f\u73af\u5883\u7684\u540d\u79f0\uff0c<code>3.8<\/code>\u662fPython\u7248\u672c\uff0c\u60a8\u53ef\u4ee5\u6839\u636e\u9700\u8981\u66f4\u6539\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6fc0\u6d3b\u73af\u5883<\/strong><br \/>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6fc0\u6d3b\u65b0\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><p>\u6fc0\u6d3b\u540e\uff0c\u60a8\u5c06\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\u4e2d\u770b\u5230\u73af\u5883\u540d\u79f0\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u989d\u5916\u5305<\/strong><br \/>\u6fc0\u6d3b\u73af\u5883\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>conda install package_name<\/code>\u547d\u4ee4\u5b89\u88c5\u6240\u9700\u7684Python\u5305\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda install numpy pandas<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5217\u51fa\u548c\u7ba1\u7406\u73af\u5883<\/strong><br \/>\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5df2\u6709\u7684\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda env list<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8981\u5220\u9664\u73af\u5883\uff0c\u53ef\u4ee5\u4f7f\u7528\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda remove --name myenv --all<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p><strong>\u6ce8\u610f\u4e8b\u9879<\/strong>\uff1a\u4f7f\u7528conda\u547d\u4ee4\u884c\u7684\u4f18\u70b9\u662f\u5feb\u901f\u3001\u7075\u6d3b\uff0c\u9002\u5408\u6709\u4e00\u5b9a\u7ecf\u9a8c\u7684\u7528\u6237\u3002\u7f3a\u70b9\u662f\u5bf9\u4e0d\u719f\u6089\u547d\u4ee4\u884c\u7684\u7528\u6237\u53ef\u80fd\u6709\u4e00\u5b9a\u7684\u5b66\u4e60\u66f2\u7ebf\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u521b\u5efa\u7279\u5b9aPython\u7248\u672c\u7684\u73af\u5883<\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u7279\u5b9a\u7248\u672c\u7684Python\u6765\u786e\u4fdd\u4e0e\u9879\u76ee\u7684\u517c\u5bb9\u6027\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u9009\u62e9\u6b63\u786e\u7684Python\u7248\u672c<\/strong><br \/>\u5728\u521b\u5efa\u73af\u5883\u65f6\uff0c\u52a1\u5fc5\u6307\u5b9a\u9879\u76ee\u6240\u9700\u7684Python\u7248\u672c\u3002\u60a8\u53ef\u4ee5\u67e5\u770b\u9879\u76ee\u7684\u4f9d\u8d56\u6587\u4ef6\uff08\u5982requirements.txt\uff09\u4ee5\u4e86\u89e3\u6240\u9700\u7684\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u7279\u5b9a\u7248\u672c\u7684\u5305<\/strong><br \/>\u5728\u521b\u5efa\u73af\u5883\u540e\uff0c\u60a8\u53ef\u80fd\u8fd8\u9700\u8981\u5b89\u88c5\u7279\u5b9a\u7248\u672c\u7684Python\u5305\u4ee5\u786e\u4fdd\u517c\u5bb9\u6027\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u6307\u5b9a\u5305\u7684\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda install package_name=version_number<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda install numpy=1.19.2<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6d4b\u8bd5\u73af\u5883<\/strong><br \/>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u5efa\u8bae\u6d4b\u8bd5\u73af\u5883\u4ee5\u786e\u4fdd\u6240\u6709\u5305\u548cPython\u7248\u672c\u5747\u6b63\u5e38\u5de5\u4f5c\u3002\u53ef\u4ee5\u8fd0\u884c\u9879\u76ee\u7684\u6d4b\u8bd5\u5957\u4ef6\u6216\u6267\u884c\u4e00\u4e9b\u7b80\u5355\u7684Python\u811a\u672c\u8fdb\u884c\u9a8c\u8bc1\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p><strong>\u6ce8\u610f\u4e8b\u9879<\/strong>\uff1a\u521b\u5efa\u7279\u5b9aPython\u7248\u672c\u7684\u73af\u5883\u6709\u52a9\u4e8e\u9879\u76ee\u7684\u7a33\u5b9a\u6027\uff0c\u5c24\u5176\u662f\u5728\u56e2\u961f\u5408\u4f5c\u6216\u90e8\u7f72\u5230\u751f\u4ea7\u73af\u5883\u65f6\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u4f7f\u7528YAML\u6587\u4ef6\u7ba1\u7406\u73af\u5883<\/p>\n<\/p>\n<p><p>\u5982\u679c\u60a8\u9700\u8981\u5728\u4e0d\u540c\u7684\u673a\u5668\u6216\u56e2\u961f\u6210\u5458\u4e4b\u95f4\u5171\u4eab\u73af\u5883\u914d\u7f6e\uff0c\u4f7f\u7528YAML\u6587\u4ef6\u662f\u4e00\u79cd\u6709\u6548\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5bfc\u51fa\u73af\u5883<\/strong><br \/>\u5728\u73b0\u6709\u73af\u5883\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5bfc\u51fa\u73af\u5883\u914d\u7f6e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda env export &gt; environment.yml<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u751f\u6210\u4e00\u4e2a\u540d\u4e3a<code>environment.yml<\/code>\u7684\u6587\u4ef6\uff0c\u5305\u542b\u73af\u5883\u4e2d\u7684\u6240\u6709\u5305\u53ca\u5176\u7248\u672c\u4fe1\u606f\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efa\u73af\u5883<\/strong><br \/>\u5728\u53e6\u4e00\u53f0\u673a\u5668\u4e0a\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4eceYAML\u6587\u4ef6\u521b\u5efa\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda env create -f environment.yml<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u6839\u636eYAML\u6587\u4ef6\u7684\u4fe1\u606f\u521b\u5efa\u65b0\u7684Python\u73af\u5883\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u66f4\u65b0\u73af\u5883<\/strong><br \/>\u5982\u679cYAML\u6587\u4ef6\u6709\u6240\u66f4\u65b0\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u66f4\u65b0\u73b0\u6709\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda env update -f environment.yml<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p><strong>\u6ce8\u610f\u4e8b\u9879<\/strong>\uff1a\u4f7f\u7528YAML\u6587\u4ef6\u53ef\u4ee5\u786e\u4fdd\u73af\u5883\u7684\u4e00\u81f4\u6027\uff0c\u5c24\u5176\u662f\u5728\u56e2\u961f\u5408\u4f5c\u4e2d\u3002\u4f46\u9700\u6ce8\u610f\u6587\u4ef6\u7684\u7248\u672c\u63a7\u5236\uff0c\u4ee5\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u51b2\u7a81\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001Anaconda\u73af\u5883\u7ba1\u7406\u7684\u6700\u4f73\u5b9e\u8df5<\/p>\n<\/p>\n<p><p>\u5728\u4f7f\u7528Anaconda\u7ba1\u7406Python\u73af\u5883\u65f6\uff0c\u9075\u5faa\u4e00\u4e9b\u6700\u4f73\u5b9e\u8df5\u53ef\u4ee5\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\u5e76\u51cf\u5c11\u95ee\u9898\u7684\u53d1\u751f\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u547d\u540d\u73af\u5883<\/strong><br \/>\u4e3a\u73af\u5883\u4f7f\u7528\u6709\u610f\u4e49\u7684\u540d\u79f0\u53ef\u4ee5\u5e2e\u52a9\u60a8\u5feb\u901f\u8bc6\u522b\u5176\u7528\u9014\u3002\u4f8b\u5982\uff0c\u4f7f\u7528\u9879\u76ee\u540d\u79f0\u6216\u529f\u80fd\u4f5c\u4e3a\u73af\u5883\u540d\u79f0\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b9a\u671f\u66f4\u65b0\u73af\u5883<\/strong><br \/>\u5b9a\u671f\u4f7f\u7528<code>conda update<\/code>\u547d\u4ee4\u66f4\u65b0\u73af\u5883\u4e2d\u7684\u5305\uff0c\u4ee5\u83b7\u53d6\u6700\u65b0\u7684\u529f\u80fd\u548c\u4fee\u590d\u3002\u4f46\u5728\u66f4\u65b0\u524d\uff0c\u5efa\u8bae\u5907\u4efd\u73af\u5883\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5206\u79bb\u5f00\u53d1\u548c\u751f\u4ea7\u73af\u5883<\/strong><br \/>\u5728\u5f00\u53d1\u548c\u751f\u4ea7\u4e2d\u4f7f\u7528\u4e0d\u540c\u7684\u73af\u5883\u53ef\u4ee5\u51cf\u5c11\u610f\u5916\u95ee\u9898\u7684\u53d1\u751f\u3002\u5f00\u53d1\u73af\u5883\u53ef\u4ee5\u5305\u542b\u66f4\u591a\u8c03\u8bd5\u5de5\u5177\uff0c\u800c\u751f\u4ea7\u73af\u5883\u5219\u5e94\u4fdd\u6301\u7cbe\u7b80\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528\u865a\u62df\u73af\u5883<\/strong><br \/>\u867d\u7136Anaconda\u63d0\u4f9b\u4e86\u73af\u5883\u7ba1\u7406\u529f\u80fd\uff0c\u4f46\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528Python\u7684<code>venv<\/code>\u6a21\u5757\u521b\u5efa\u865a\u62df\u73af\u5883\u4e5f\u662f\u4e00\u79cd\u9009\u62e9\uff0c\u7279\u522b\u662f\u5728\u8d44\u6e90\u6709\u9650\u7684\u60c5\u51b5\u4e0b\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b9a\u671f\u6e05\u7406\u672a\u4f7f\u7528\u7684\u73af\u5883<\/strong><br \/>\u957f\u65f6\u95f4\u4f7f\u7528Anaconda\u540e\uff0c\u53ef\u80fd\u4f1a\u79ef\u7d2f\u8bb8\u591a\u4e0d\u518d\u4f7f\u7528\u7684\u73af\u5883\u3002\u5b9a\u671f\u6e05\u7406\u8fd9\u4e9b\u73af\u5883\u53ef\u4ee5\u91ca\u653e\u7cfb\u7edf\u8d44\u6e90\u5e76\u63d0\u9ad8Anaconda\u7684\u6027\u80fd\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p><strong>\u6ce8\u610f\u4e8b\u9879<\/strong>\uff1a\u9075\u5faa\u8fd9\u4e9b\u6700\u4f73\u5b9e\u8df5\u53ef\u4ee5\u5e2e\u52a9\u60a8\u66f4\u6709\u6548\u5730\u4f7f\u7528Anaconda\uff0c\u5e76\u51cf\u5c11\u5728\u73af\u5883\u7ba1\u7406\u4e2d\u9047\u5230\u7684\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><p>\u603b\u7ed3\uff0cAnaconda\u63d0\u4f9b\u4e86\u4e00\u5957\u5f3a\u5927\u4e14\u7075\u6d3b\u7684\u5de5\u5177\u6765\u7ba1\u7406Python\u73af\u5883\u3002\u65e0\u8bba\u662f\u901a\u8fc7\u56fe\u5f62\u754c\u9762\u8fd8\u662f\u547d\u4ee4\u884c\uff0c\u60a8\u90fd\u53ef\u4ee5\u8f7b\u677e\u521b\u5efa\u548c\u7ba1\u7406\u4e0d\u540c\u7684Python\u7248\u672c\u548c\u5305\uff0c\u4ee5\u6ee1\u8db3\u4e0d\u540c\u9879\u76ee\u7684\u9700\u6c42\u3002\u901a\u8fc7\u9075\u5faa\u4e0a\u8ff0\u65b9\u6cd5\u548c\u6700\u4f73\u5b9e\u8df5\uff0c\u60a8\u53ef\u4ee5\u786e\u4fddPython\u73af\u5883\u7684\u7a33\u5b9a\u6027\u548c\u4e00\u81f4\u6027\uff0c\u4e3a\u9879\u76ee\u7684\u6210\u529f\u5960\u5b9a\u575a\u5b9e\u7684\u57fa\u7840\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Anaconda\u4e2d\u521b\u5efa\u65b0\u7684Python\u73af\u5883\uff1f<\/strong><br \/>\u5728Anaconda\u4e2d\u521b\u5efa\u65b0\u7684Python\u73af\u5883\u76f8\u5bf9\u7b80\u5355\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528Anaconda Navigator\u56fe\u5f62\u754c\u9762\u6216\u547d\u4ee4\u884c\u754c\u9762\u3002\u901a\u8fc7\u547d\u4ee4\u884c\uff0c\u60a8\u53ea\u9700\u6253\u5f00Anaconda Prompt\uff0c\u8f93\u5165<code>conda create --name myenv python=3.8<\/code>\uff08\u5c06&quot;myenv&quot;\u66ff\u6362\u4e3a\u60a8\u5e0c\u671b\u7684\u73af\u5883\u540d\u79f0\uff0c3.8\u4e3a\u60a8\u60f3\u8981\u7684Python\u7248\u672c\uff09\u3002\u6267\u884c\u540e\uff0c\u6309\u7167\u63d0\u793a\u786e\u8ba4\u5373\u53ef\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Anaconda\u4e2d\u5b89\u88c5\u7279\u5b9a\u5e93\u5230\u65b0\u521b\u5efa\u7684Python\u73af\u5883\u4e2d\uff1f<\/strong><br \/>\u5728\u65b0\u521b\u5efa\u7684\u73af\u5883\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>conda install package_name<\/code>\u547d\u4ee4\u6765\u5b89\u88c5\u7279\u5b9a\u7684\u5e93\u3002\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u60f3\u5b89\u88c5NumPy\uff0c\u53ef\u4ee5\u6fc0\u6d3b\u73af\u5883\uff08\u8f93\u5165<code>conda activate myenv<\/code>\uff09\uff0c\u7136\u540e\u8fd0\u884c<code>conda install numpy<\/code>\u3002\u8fd9\u6837\uff0cNumPy\u5c06\u88ab\u5b89\u88c5\u5230\u60a8\u7684\u65b0\u73af\u5883\u4e2d\u3002<\/p>\n<p><strong>\u5982\u4f55\u67e5\u770bAnaconda\u4e2d\u5df2\u6709\u7684Python\u73af\u5883\u53ca\u5176\u7248\u672c\uff1f<\/strong><br \/>\u8981\u67e5\u770b\u60a8\u5728Anaconda\u4e2d\u521b\u5efa\u7684\u6240\u6709\u73af\u5883\u53ca\u5176\u76f8\u5173\u4fe1\u606f\uff0c\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4<code>conda env list<\/code>\u6216<code>conda info --envs<\/code>\u3002\u8fd9\u4e9b\u547d\u4ee4\u4f1a\u5217\u51fa\u6240\u6709\u73af\u5883\u7684\u540d\u79f0\u548c\u8def\u5f84\uff0c\u540c\u65f6\u663e\u793a\u5f53\u524d\u6fc0\u6d3b\u7684\u73af\u5883\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u7ba1\u7406\u548c\u5207\u6362\u4e0d\u540c\u7684Python\u73af\u5883\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Anaconda\u6dfb\u52a0Python\u73af\u5883\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528Anaconda Navigator\u3001\u4f7f\u7528conda\u547d\u4ee4\u884c [&hellip;]","protected":false},"author":3,"featured_media":996735,"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\/996725"}],"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=996725"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/996725\/revisions"}],"predecessor-version":[{"id":996740,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/996725\/revisions\/996740"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/996735"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=996725"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=996725"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=996725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}