{"id":73355,"date":"2026-11-20T09:00:00","date_gmt":"2026-11-20T01:00:00","guid":{"rendered":"https:\/\/www.biocloudservice.com\/wordpress\/?p=73355"},"modified":"2026-11-16T21:14:56","modified_gmt":"2026-11-16T13:14:56","slug":"conda-practical-series-04","status":"publish","type":"post","link":"https:\/\/www.biocloudservice.com\/wordpress\/conda-practical-series-04\/","title":{"rendered":"Conda \u4f7f\u7528\u6280\u5de7\uff08\u56db\uff09\uff1a\u73af\u5883\u914d\u597d\u540e\u600e\u4e48\u4fdd\u5b58\uff1f\u4ece environment.yml \u5230\u590d\u73b0\u9a8c\u6536"},"content":{"rendered":"<div class=\"ysx-conda-series\" style=\"max-width:880px;margin:auto;font-size:17px;line-height:1.9;overflow-wrap:anywhere\">\n<p>\u7ecf\u8fc7\u524d\u4e09\u7bc7\uff0c\u4f60\u5df2\u7ecf\u80fd\u521b\u5efa\u73af\u5883\u3001\u5b89\u88c5 Biopython\uff0c\u5e76\u5904\u7406\u5e38\u89c1\u7684\u8fd0\u884c\u9519\u8bef\u3002\u63a5\u4e0b\u6765\u4f1a\u51fa\u73b0\u4e00\u4e2a\u66f4\u5b9e\u9645\u7684\u95ee\u9898\uff1a\u6362\u4e00\u53f0\u7535\u8111\u3001\u4ea4\u7ed9\u540c\u4e8b\uff0c\u6216\u8005\u534a\u5e74\u4ee5\u540e\u518d\u505a\u4e00\u904d\uff0c\u600e\u6837\u77e5\u9053\u81ea\u5df1\u4f7f\u7528\u7684\u8fd8\u662f\u90a3\u5957\u8f6f\u4ef6\uff1f\u53ea\u5199\u4e00\u53e5\u201c\u9700\u8981 Python \u548c Biopython\u201d\uff0c\u901a\u5e38\u65e0\u6cd5\u89e3\u91ca\u7248\u672c\u3001\u6e20\u9053\u548c\u5e73\u53f0\u4e4b\u95f4\u7684\u5dee\u5f02\u3002<\/p>\n<p>\u8fd9\u4e00\u7bc7\u7ee7\u7eed\u4f7f\u7528\u4e24\u6761\u5e8f\u5217\u7684\u7edf\u8ba1\u9879\u76ee\uff0c\u628a\u73af\u5883\u8bb0\u5f55\u62c6\u6210\u4e09\u4e2a\u5c42\u6b21\uff1a\u8868\u8fbe\u9879\u76ee\u9700\u8981\u4ec0\u4e48\uff0c\u8bb0\u5f55\u8fd9\u6b21\u5b9e\u9645\u88c5\u4e86\u4ec0\u4e48\uff0c\u9a8c\u8bc1\u91cd\u5efa\u4ee5\u540e\u505a\u51fa\u4e86\u4ec0\u4e48\u3002\u4e09\u5c42\u4e00\u8d77\u4fdd\u5b58\uff0c\u624d\u80fd\u907f\u514d\u201c\u6587\u4ef6\u90fd\u4ea4\u4e86\uff0c\u540c\u4e8b\u8fd8\u662f\u8dd1\u4e0d\u901a\u201d\u7684\u60c5\u51b5\u3002\u6211\u4eec\u8ffd\u6c42\u7684\u662f\u53ef\u89e3\u91ca\u3001\u53ef\u6838\u5bf9\u7684\u590d\u73b0\u8fc7\u7a0b\uff0c\u4e0d\u628a\u4e00\u4efd\u5bfc\u51fa\u6587\u4ef6\u5938\u5927\u6210\u8de8\u5e73\u53f0\u4e07\u80fd\u5907\u4efd\u3002<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" style=\"display:block;width:100%;height:auto;margin:24px 0\" alt=\"\u7b2c\u56db\u7bc7\u793a\u610f\uff1a\u9879\u76ee\u9700\u6c42\u3001\u5b9e\u9645\u5b89\u88c5\u4e0e\u7ed3\u679c\u9a8c\u6536\u4e09\u5c42\u4fdd\u5b58\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/conda-series-20261116-figure-07.png?ssl=1\" \/><\/p>\n<h2 style=\"font-size:25px;line-height:1.5;margin-top:38px;color:#13565c\">\u4e00\u3001\u5148\u5199\u4e00\u4efd\u4eba\u80fd\u591f\u8bfb\u61c2\u7684\u9700\u6c42\u6e05\u5355<\/h2>\n<p>\u5728\u9879\u76ee\u76ee\u5f55\u65b0\u5efa <code>environment.yml<\/code>\uff0c\u5185\u5bb9\u5982\u4e0b\u3002YAML \u4f7f\u7528\u7a7a\u683c\u7f29\u8fdb\uff0c\u4e0d\u80fd\u628a\u7f29\u8fdb\u968f\u610f\u6539\u6210\u5236\u8868\u7b26\u3002\u73af\u5883\u540d\u79f0\u3001\u6e20\u9053\u4e0e\u4f9d\u8d56\u5404\u5360\u4e00\u4e2a\u660e\u786e\u4f4d\u7f6e\uff0c\u8bfb\u8005\u4e0d\u9700\u8981\u731c\u54ea\u4e9b\u8f6f\u4ef6\u662f\u9879\u76ee\u76f4\u63a5\u7528\u5230\u7684\u3002<\/p>\n<pre style=\"max-width:100%;overflow-x:auto;padding:18px;background:#edf4f5;border-radius:10px;font-size:14px;line-height:1.65\"><code class=\"language-yaml\">name: conda-lab\r\nchannels:\r\n  - conda-forge\r\n  - nodefaults\r\ndependencies:\r\n  - python=3.11\r\n  - biopython=1.85\r\n  - pip\r\n<\/code><\/pre>\n<p>\u8fd9\u91cc\u7684 <code>nodefaults<\/code> \u662f\u7279\u6b8a\u8bbe\u7f6e\uff0c\u7528\u4e8e\u907f\u514d\u5728\u8fd9\u4e2a\u73af\u5883\u6587\u4ef6\u7684\u6c42\u89e3\u4e2d\u989d\u5916\u52a0\u5165\u9ed8\u8ba4\u6e20\u9053\uff0c\u4e0d\u662f\u4e00\u4e2a\u771f\u5b9e\u4e0b\u8f7d\u4ed3\u5e93\u3002\u6838\u5fc3\u7248\u672c\u4fdd\u6301\u4e0e\u524d\u6587\u4e00\u81f4\uff0cpip \u88ab\u5217\u51fa\u662f\u4e3a\u4e86\u80fd\u591f\u8fdb\u884c\u76f8\u5e94\u68c0\u67e5\u3002\u6ca1\u6709\u4f7f\u7528 pip \u5b89\u88c5\u989d\u5916\u5305\uff0c\u5c31\u4e0d\u7528\u4e3a\u4e86\u663e\u5f97\u5b8c\u6574\u800c\u6dfb\u52a0\u865a\u6784\u7684 pip \u4f9d\u8d56\u6bb5\u3002<\/p>\n<p>\u8fd9\u4efd\u6e05\u5355\u8868\u8fbe\u4e86\u76f4\u63a5\u9700\u6c42\uff0c\u4f46 Python 3.11 \u4e0b\u9762\u5177\u4f53\u9009\u54ea\u4e2a\u8865\u4e01\u7248\u672c\u3001\u5e95\u5c42\u5e93\u9009\u62e9\u54ea\u4e2a\u6784\u5efa\uff0c\u4ecd\u53ef\u80fd\u968f\u65f6\u95f4\u4e0e\u5e73\u53f0\u53d8\u5316\u3002\u7cbe\u7b80\u6e05\u5355\u4fbf\u4e8e\u7406\u89e3\u548c\u7ef4\u62a4\uff0c\u5374\u4e0d\u7b49\u4e8e\u9010\u4e2a\u8f6f\u4ef6\u5305\u90fd\u88ab\u5b8c\u5168\u9501\u5b9a\u3002\u76f8\u5173\u73af\u5883\u6587\u4ef6\u884c\u4e3a\u89c1 <a href=\"https:\/\/docs.conda.io\/projects\/conda\/en\/stable\/user-guide\/tasks\/manage-environments.html\">Conda \u73af\u5883\u7ba1\u7406\u6587\u6863<\/a>\u3002<\/p>\n<p>\u5982\u679c\u9879\u76ee\u5b9e\u9645\u7528\u8fc7\u66f4\u591a\u4f9d\u8d56\uff0c\u5e94\u5728\u8fd9\u91cc\u5982\u5b9e\u8865\u9f50\u3002\u5c24\u5176\u662f\u6267\u884c\u811a\u672c\u65f6\u4e34\u65f6\u8c03\u7528\u7684\u5916\u90e8\u547d\u4ee4\uff0c\u4e0d\u80fd\u56e0\u4e3a\u5b83\u4e0d\u51fa\u73b0\u5728 Python \u7684 <code>import<\/code> \u8bed\u53e5\u4e2d\u5c31\u5fd8\u8bb0\u8bb0\u5f55\u3002\u6570\u636e\u5e93\u3001\u53c2\u8003\u57fa\u56e0\u7ec4\u548c\u6a21\u578b\u6743\u91cd\u5219\u9700\u8981\u5355\u72ec\u8bb0\u5f55\uff0c\u5b83\u4eec\u4e0d\u4e00\u5b9a\u5c5e\u4e8e Conda \u7ba1\u7406\u7684\u8f6f\u4ef6\u5305\u3002<\/p>\n<h2 style=\"font-size:25px;line-height:1.5;margin-top:38px;color:#13565c\">\u4e8c\u3001\u5bfc\u51fa\u6587\u4ef6\u4e4b\u524d\uff0c\u5148\u660e\u786e\u63a5\u6536\u8005\u9700\u8981\u4ec0\u4e48<\/h2>\n<p>\u9762\u5bf9\u540c\u4e8b\u4ea4\u63a5\uff0c\u5e38\u89c1\u9700\u6c42\u6709\u4e24\u79cd\uff1a\u4e00\u79cd\u662f\u8ba9\u5bf9\u65b9\u770b\u61c2\u9879\u76ee\u9700\u8981\u54ea\u4e9b\u8f6f\u4ef6\uff0c\u53e6\u4e00\u79cd\u662f\u5c3d\u53ef\u80fd\u4fdd\u7559\u5f53\u524d\u673a\u5668\u5b89\u88c5\u72b6\u6001\u3002\u5b83\u4eec\u9002\u5408\u4e0d\u540c\u7c92\u5ea6\u7684\u6587\u4ef6\u3002\u4e0b\u9762\u5728\u9879\u76ee\u76ee\u5f55\u6267\u884c\u5bfc\u51fa\uff0c\u5148\u4fdd\u7559\u539f\u59cb\u6587\u4ef6\uff0c\u518d\u68c0\u67e5\u5185\u5bb9\uff0c\u4e0d\u8981\u7acb\u523b\u53d1\u9001\u5230\u516c\u5171\u4ed3\u5e93\u3002<\/p>\n<pre style=\"max-width:100%;overflow-x:auto;padding:18px;background:#edf4f5;border-radius:10px;font-size:14px;line-height:1.65\"><code class=\"language-bash\">conda env export -n conda-lab --from-history &gt; environment-history.yml\r\nconda env export -n conda-lab --no-builds &gt; environment-resolved.yml\r\nconda list -n conda-lab --explicit &gt; explicit-platform.txt\r\n<\/code><\/pre>\n<p>\u7b2c\u4e00\u4efd\u4e3b\u8981\u4f53\u73b0\u663e\u5f0f\u8bf7\u6c42\u7684 Conda \u4f9d\u8d56\uff0c\u4fbf\u4e8e\u8868\u8fbe\u5b89\u88c5\u610f\u56fe\uff0c\u4f46\u4e0d\u8981\u5047\u8bbe\u5b83\u5b8c\u6574\u5305\u542b\u6240\u6709\u989d\u5916 pip \u5b89\u88c5\u60c5\u51b5\u3002\u7b2c\u4e8c\u4efd\u8bb0\u5f55\u66f4\u5b8c\u6574\u7684\u8f6f\u4ef6\u7248\u672c\u5e76\u53bb\u6389\u6784\u5efa\u5b57\u7b26\u4e32\uff0c\u901a\u5e38\u4ecd\u5e26\u6709\u5e73\u53f0\u76f8\u5173\u4f9d\u8d56\u3002\u7b2c\u4e09\u4efd\u8bb0\u5f55\u7cbe\u786e\u5305\u6765\u6e90\uff0c\u9002\u5408\u76f8\u540c\u5e73\u53f0\u7684\u91cd\u5efa\u8def\u5f84\uff0c\u4f46\u4ecd\u9700\u8981\u80fd\u591f\u83b7\u53d6\u76f8\u5e94\u5305\u6587\u4ef6\u3002\u5bfc\u51fa\u9009\u9879\u89c1 <a href=\"https:\/\/docs.conda.io\/projects\/conda\/en\/stable\/commands\/env\/export.html\">conda env export<\/a> \u4e0e <a href=\"https:\/\/docs.conda.io\/projects\/conda\/en\/stable\/commands\/list.html\">conda list<\/a>\u3002<\/p>\n<div style=\"overflow-x:auto\">\n<table style=\"min-width:560px;width:100%;border-collapse:collapse\">\n<thead>\n<tr>\n<th style=\"padding:12px;background:#e8f5f1;border:1px solid #c9ded7;text-align:left\">\u4fdd\u5b58\u65b9\u5f0f<\/th>\n<th style=\"padding:12px;background:#e8f5f1;border:1px solid #c9ded7;text-align:left\">\u4e3b\u8981\u7528\u9014<\/th>\n<th style=\"padding:12px;background:#e8f5f1;border:1px solid #c9ded7;text-align:left\">\u4e0d\u80fd\u636e\u6b64\u4fdd\u8bc1\u7684\u4e8b<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding:12px;border:1px solid #c9ded7\">\u624b\u5199\u7cbe\u7b80 YAML<\/td>\n<td style=\"padding:12px;border:1px solid #c9ded7\">\u63cf\u8ff0\u9879\u76ee\u76f4\u63a5\u9700\u6c42<\/td>\n<td style=\"padding:12px;border:1px solid #c9ded7\">\u6bcf\u4e2a\u5e95\u5c42\u5305\u5b8c\u5168\u4e0d\u53d8<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px;border:1px solid #c9ded7\">\u5386\u53f2\u9700\u6c42\u5bfc\u51fa<\/td>\n<td style=\"padding:12px;border:1px solid #c9ded7\">\u56de\u987e\u663e\u5f0f\u5b89\u88c5\u8bf7\u6c42<\/td>\n<td style=\"padding:12px;border:1px solid #c9ded7\">\u6536\u9f50\u6240\u6709\u5916\u90e8\u8f6f\u4ef6\u4e0e\u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px;border:1px solid #c9ded7\">\u5b8c\u6574\u7248\u672c\u5bfc\u51fa<\/td>\n<td style=\"padding:12px;border:1px solid #c9ded7\">\u6392\u67e5\u5b9e\u9645\u4f9d\u8d56\u5dee\u5f02<\/td>\n<td style=\"padding:12px;border:1px solid #c9ded7\">\u8de8\u7cfb\u7edf\u65e0\u6761\u4ef6\u91cd\u5efa<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px;border:1px solid #c9ded7\">explicit \u6587\u4ef6<\/td>\n<td style=\"padding:12px;border:1px solid #c9ded7\">\u540c\u5e73\u53f0\u7cbe\u786e\u6307\u5b9a\u5305<\/td>\n<td style=\"padding:12px;border:1px solid #c9ded7\">\u5305\u6c38\u8fdc\u53ef\u4e0b\u8f7d\u3001\u4efb\u610f\u5e73\u53f0\u53ef\u7528<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px;border:1px solid #c9ded7\">\u5c0f\u6837\u4f8b\u4e0e\u671f\u671b\u7ed3\u679c<\/td>\n<td style=\"padding:12px;border:1px solid #c9ded7\">\u9a8c\u8bc1\u9879\u76ee\u884c\u4e3a<\/td>\n<td style=\"padding:12px;border:1px solid #c9ded7\">\u5b8c\u6574\u79d1\u7814\u7ed3\u8bba\u81ea\u52a8\u590d\u73b0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u5bfc\u51fa\u540e\u8981\u68c0\u67e5\u662f\u5426\u5b58\u5728\u672c\u673a <code>prefix<\/code> \u8def\u5f84\u3001\u7528\u6237\u540d\u3001\u5185\u90e8\u6e20\u9053\u5730\u5740\u6216\u8ba4\u8bc1\u4fe1\u606f\u3002\u516c\u5f00\u5206\u4eab\u7684\u73af\u5883\u8bf4\u660e\u4e0d\u5e94\u5e26\u5165\u8fd9\u4e9b\u5185\u5bb9\u3002\u7cbe\u7b80\u6e05\u5355\u53ef\u4ee5\u4fdd\u7559\u5fc5\u8981\u7684\u516c\u5f00\u6e20\u9053\uff0c\u79fb\u9664\u4ec5\u5c5e\u4e8e\u81ea\u5df1\u7535\u8111\u7684\u7edd\u5bf9\u5b89\u88c5\u4f4d\u7f6e\uff1b\u539f\u59cb\u5bfc\u51fa\u5219\u7559\u4f5c\u5185\u90e8\u6392\u67e5\u4f9d\u636e\u3002\u5220\u6389\u8def\u5f84\u4e0d\u7b49\u4e8e\u89e3\u51b3\u4e86\u6240\u6709\u53ef\u79fb\u690d\u6027\u95ee\u9898\uff0c\u4ecd\u7136\u9700\u8981\u4e0b\u4e00\u6b65\u5b9e\u9645\u91cd\u5efa\u3002<\/p>\n<p>\u65b0\u7248 Conda \u8fd8\u63d0\u4f9b\u66f4\u7edf\u4e00\u7684 <code>conda export<\/code> \u547d\u4ee4\u548c\u683c\u5f0f\u9009\u9879\uff0c\u65e7\u73af\u5883\u672a\u5fc5\u5177\u5907\u76f8\u540c\u63a5\u53e3\u3002\u672c\u7cfb\u5217\u4fdd\u7559\u5e7f\u6cdb\u4f7f\u7528\u7684\u4f20\u7edf\u5bfc\u51fa\u5f62\u5f0f\uff0c\u907f\u514d\u8bfb\u8005\u4e3a\u4e86\u5b66\u4e00\u4e2a\u4f8b\u5b50\u5c31\u5148\u5347\u7ea7\u7ba1\u7406\u5de5\u5177\u3002\u9700\u8981\u65b0\u63a5\u53e3\u65f6\u5148\u68c0\u67e5\u672c\u673a\u5e2e\u52a9\uff0c\u5e76\u5bf9\u7167 <a href=\"https:\/\/docs.conda.io\/projects\/conda\/en\/stable\/commands\/export.html\">conda export \u5b98\u65b9\u6587\u6863<\/a>\uff0c\u4e0d\u8981\u6df7\u6dc6\u4e0d\u540c\u7248\u672c\u652f\u6301\u7684\u53c2\u6570\u3002<\/p>\n<h2 style=\"font-size:25px;line-height:1.5;margin-top:38px;color:#13565c\">\u4e09\u3001\u7528\u65b0\u540d\u5b57\u91cd\u5efa\uff0c\u624d\u80fd\u68c0\u9a8c\u6587\u4ef6\u6709\u6ca1\u6709\u6f0f\u4e1c\u897f<\/h2>\n<p>\u4e0d\u8981\u76f4\u63a5\u8986\u76d6\u6b63\u5728\u5de5\u4f5c\u7684 <code>conda-lab<\/code>\u3002\u5148\u5728\u540c\u4e00\u53f0\u673a\u5668\u4e0a\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a <code>conda-lab-copy<\/code> \u7684\u65b0\u73af\u5883\uff0c\u4ece\u9879\u76ee\u76ee\u5f55\u8bfb\u53d6\u624b\u5199\u7684 <code>environment.yml<\/code>\u3002\u540d\u5b57\u6362\u4e86\uff0c\u539f\u6765\u7684\u73af\u5883\u5c31\u53ef\u4ee5\u4fdd\u7559\u7528\u4e8e\u5bf9\u7167\u3002<\/p>\n<pre style=\"max-width:100%;overflow-x:auto;padding:18px;background:#edf4f5;border-radius:10px;font-size:14px;line-height:1.65\"><code class=\"language-bash\">conda env create -n conda-lab-copy -f environment.yml\r\nconda run -n conda-lab-copy python -c &quot;import sys, Bio; print(sys.executable); print(Bio.__version__)&quot;\r\nconda run -n conda-lab-copy python summarize_fasta.py demo.fa\r\n<\/code><\/pre>\n<p>\u6210\u529f\u521b\u5efa\u53ea\u662f\u7b2c\u4e00\u9053\u68c0\u67e5\u3002\u8fd8\u8981\u786e\u8ba4\u89e3\u91ca\u5668\u8def\u5f84\u5c5e\u4e8e\u65b0\u73af\u5883\uff0cBiopython \u7248\u672c\u7b26\u5408\u6e05\u5355\uff0c\u4e24\u4e2a\u5e8f\u5217\u7684\u7edf\u8ba1\u7ed3\u679c\u4e0e\u539f\u73af\u5883\u4e00\u81f4\u3002\u5982\u679c\u65b0\u73af\u5883\u8fd0\u884c\u5931\u8d25\uff0c\u4e0d\u8981\u7acb\u523b\u4ece\u65e7\u73af\u5883\u91cc\u968f\u4fbf\u590d\u5236\u6587\u4ef6\u8865\u6d1e\u3002\u5148\u627e\u51fa\u7f3a\u7684\u662f\u54ea\u4e2a\u4f9d\u8d56\uff0c\u628a\u5b83\u8865\u8fdb\u8bf4\u660e\uff0c\u518d\u91cd\u65b0\u9a8c\u8bc1\uff0c\u624d\u80fd\u628a\u9690\u542b\u6761\u4ef6\u53d8\u6210\u660e\u786e\u6761\u4ef6\u3002<\/p>\n<p>\u5982\u679c\u76ee\u6807\u662f\u540c\u5e73\u53f0\u7cbe\u786e\u5305\u91cd\u5efa\uff0c\u53ef\u4ee5\u4f7f\u7528 explicit \u6587\u4ef6\u521b\u5efa\u53e6\u4e00\u4e2a\u65b0\u73af\u5883\u3002\u6ce8\u610f\u9605\u8bfb\u6587\u4ef6\u5934\u90e8\u7684\u5e73\u53f0\u4fe1\u606f\uff0c\u5e76\u4fdd\u7559\u539f\u59cb\u5305\u6e20\u9053\uff1b\u8de8 Linux\u3001Windows\u3001macOS \u6216\u5904\u7406\u5668\u67b6\u6784\u65f6\uff0c\u4e0d\u5e94\u76f4\u63a5\u5047\u5b9a\u8fd9\u6761\u8def\u7ebf\u53ef\u7528\u3002<\/p>\n<pre style=\"max-width:100%;overflow-x:auto;padding:18px;background:#edf4f5;border-radius:10px;font-size:14px;line-height:1.65\"><code class=\"language-bash\">conda create -n conda-lab-exact --file explicit-platform.txt\r\nconda run -n conda-lab-exact python summarize_fasta.py demo.fa\r\n<\/code><\/pre>\n<p>\u8fd9\u6761\u547d\u4ee4\u9488\u5bf9 Conda \u5305\u8bb0\u5f55\uff0c\u4e0d\u4f1a\u81ea\u52a8\u628a\u9879\u76ee\u6587\u4ef6\u3001\u53c2\u8003\u5e93\u548c\u6240\u6709\u5916\u90e8\u8d44\u6e90\u4e00\u8d77\u642c\u8fc7\u53bb\u3002\u82e5\u9879\u76ee\u4f7f\u7528 pip \u4f9d\u8d56\uff0c\u5e94\u989d\u5916\u8bb0\u5f55\u548c\u5b89\u88c5\u5b83\u4eec\uff0c\u518d\u6d4b\u8bd5\u3002\u4e0d\u8981\u628a\u201c\u73af\u5883\u521b\u5efa\u6210\u529f\u201d\u5199\u6210\u201c\u8bba\u6587\u5b8c\u5168\u590d\u73b0\u6210\u529f\u201d\uff0c\u524d\u8005\u53ea\u8986\u76d6\u8f6f\u4ef6\u51c6\u5907\u7684\u4e00\u90e8\u5206\u3002<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" style=\"display:block;width:100%;height:auto;margin:24px 0\" alt=\"\u7b2c\u56db\u7bc7\u9a8c\u6536\u793a\u610f\uff1a\u65b0\u73af\u5883\u8bfb\u540c\u4e00\u8f93\u5165\uff0c\u6bd4\u8f83\u76f8\u540c\u7ed3\u679c\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/conda-series-20261116-figure-08.png?ssl=1\" \/><\/p>\n<h2 style=\"font-size:25px;line-height:1.5;margin-top:38px;color:#13565c\">\u56db\u3001\u628a\u7ed3\u679c\u6bd4\u8f83\u5199\u6210\u673a\u5668\u80fd\u591f\u68c0\u67e5\u7684\u4e00\u6b65<\/h2>\n<p>\u7ec8\u7aef\u91cc\u6eda\u52a8\u8fc7\u7684\u8f93\u51fa\u5f88\u5bb9\u6613\u4e22\u5931\u3002\u53ef\u4ee5\u5206\u522b\u5728\u539f\u73af\u5883\u548c\u65b0\u73af\u5883\u8fd0\u884c\uff0c\u628a\u7edf\u8ba1\u7ed3\u679c\u4fdd\u5b58\u5728\u4e24\u4e2a\u6587\u4ef6\u4e2d\u3002\u4e3a\u4e86\u7edf\u4e00\u6587\u672c\u7f16\u7801\uff0c\u4e0b\u9762\u4fdd\u5b58\u8fc7\u7a0b\u7531 Python \u5b8c\u6210\uff0c\u4e0d\u4f9d\u8d56\u4e0d\u540c shell \u7684\u91cd\u5b9a\u5411\u7f16\u7801\u89c4\u5219\u3002\u5148\u628a\u4ee3\u7801\u4fdd\u5b58\u4e3a <code>compare_envs.py<\/code>\uff0c\u518d\u4ece\u80fd\u591f\u8c03\u7528 Conda \u7684\u7ec8\u7aef\u8fd0\u884c\u3002<\/p>\n<pre style=\"max-width:100%;overflow-x:auto;padding:18px;background:#edf4f5;border-radius:10px;font-size:14px;line-height:1.65\"><code class=\"language-python\">import subprocess\r\nfrom pathlib import Path\r\n\r\noutputs = []\r\nfor env in (&quot;conda-lab&quot;, &quot;conda-lab-copy&quot;):\r\n    result = subprocess.run(\r\n        [&quot;conda&quot;, &quot;run&quot;, &quot;-n&quot;, env, &quot;python&quot;, &quot;summarize_fasta.py&quot;, &quot;demo.fa&quot;],\r\n        check=True, capture_output=True, text=True, encoding=&quot;utf-8&quot;\r\n    )\r\n    text = result.stdout.strip().replace(&quot;\\r\\n&quot;, &quot;\\n&quot;) + &quot;\\n&quot;\r\n    Path(f&quot;{env}.tsv&quot;).write_text(text, encoding=&quot;utf-8&quot;)\r\n    outputs.append(text)\r\nexpected = &quot;id\\tlength\\tgc_percent\\nseq_A\\t8\\t50.00\\nseq_B\\t6\\t66.67\\n&quot;\r\nassert outputs[0] == outputs[1] == expected, &quot;Result mismatch&quot;\r\nprint(&quot;PASS: both environments match the expected result&quot;)\r\n<\/code><\/pre>\n<pre style=\"max-width:100%;overflow-x:auto;padding:18px;background:#edf4f5;border-radius:10px;font-size:14px;line-height:1.65\"><code class=\"language-bash\">conda run -n conda-lab python compare_envs.py\r\n<\/code><\/pre>\n<p>\u6bd4\u8f83\u65f6\u4e0d\u4ec5\u68c0\u67e5\u4e24\u4e2a\u73af\u5883\u662f\u5426\u76f8\u540c\uff0c\u8fd8\u68c0\u67e5\u662f\u5426\u7b49\u4e8e\u624b\u5de5\u63a8\u5bfc\u7684\u9884\u671f\u7ed3\u679c\u3002\u5426\u5219\u4e24\u5957\u73af\u5883\u4ea7\u751f\u4e86\u540c\u6837\u7684\u9519\u8bef\u8f93\u51fa\uff0c\u4e5f\u53ef\u80fd\u88ab\u8bef\u5224\u4e3a\u901a\u8fc7\u3002\u5bf9\u672c\u4f8b\u8fd9\u79cd\u786e\u5b9a\u6027\u6587\u672c\uff0c\u4e25\u683c\u6bd4\u8f83\u5f88\u5408\u9002\uff1b\u6d89\u53ca\u968f\u673a\u7b97\u6cd5\u3001\u5e76\u884c\u8ba1\u7b97\u548c\u6d6e\u70b9\u8bef\u5dee\u65f6\uff0c\u5219\u9700\u8981\u63d0\u524d\u5b9a\u4e49\u968f\u673a\u79cd\u5b50\u3001\u6570\u503c\u5bb9\u5dee\u4e0e\u9a8c\u6536\u6307\u6807\u3002<\/p>\n<p>\u82e5\u7cfb\u7edf\u4e2d\u540c\u65f6\u5b89\u88c5\u4e86\u591a\u5957 Conda\uff0c\u6bd4\u8f83\u811a\u672c\u91cc\u7684 <code>conda<\/code> \u5e94\u6539\u6210\u5f53\u524d\u6240\u7528\u7ba1\u7406\u5668\u7684\u7edd\u5bf9\u8def\u5f84\u3002Windows \u7684\u547d\u4ee4\u5165\u53e3\u5f62\u5f0f\u4e5f\u53ef\u80fd\u4e0d\u540c\uff0c\u672c\u6bb5\u81ea\u52a8\u6bd4\u8f83\u811a\u672c\u4ee5 Linux \u6216 macOS \u7684 Conda \u53ef\u6267\u884c\u6587\u4ef6\u5165\u53e3\u4e3a\u9002\u7528\u6761\u4ef6\uff1bWindows \u8bfb\u8005\u53ef\u4ee5\u5148\u9010\u6761\u8fd0\u884c\u524d\u9762\u7684\u547d\u4ee4\u5bf9\u7167\u7ed3\u679c\u3002\u7b2c\u4e94\u7bc7\u4f1a\u8fdb\u4e00\u6b65\u628a\u7ba1\u7406\u5668\u4f4d\u7f6e\u5199\u8fdb\u542f\u52a8\u7a0b\u5e8f\u3002<\/p>\n<h2 style=\"font-size:25px;line-height:1.5;margin-top:38px;color:#13565c\">\u4e94\u3001\u4ea4\u7ed9\u540c\u4e8b\u7684\u5e94\u8be5\u662f\u4e00\u4e2a\u5c0f\u9879\u76ee<\/h2>\n<p>\u4e00\u4e2a\u53ef\u8bfb\u7684\u4ea4\u4ed8\u76ee\u5f55\uff0c\u81f3\u5c11\u5305\u542b\u73af\u5883\u8bf4\u660e\u3001\u5206\u6790\u811a\u672c\u3001\u4e24\u6761\u793a\u4f8b\u5e8f\u5217\u3001\u9884\u671f\u8f93\u51fa\u548c\u7b80\u77ed\u64cd\u4f5c\u8bf4\u660e\u3002\u8bf4\u660e\u91cc\u5e94\u5199\u6e05\u5728\u54ea\u4e2a\u76ee\u5f55\u6267\u884c\u3001\u5148\u8fd0\u884c\u54ea\u6761\u547d\u4ee4\u3001\u6210\u529f\u540e\u770b\u5230\u4ec0\u4e48\uff0c\u4ee5\u53ca\u54ea\u4e9b\u6b65\u9aa4\u5c5e\u4e8e\u53ef\u9009\u68c0\u67e5\u3002\u4e0d\u8981\u53ea\u53d1\u4e00\u5f20\u7ec8\u7aef\u622a\u56fe\uff0c\u8ba9\u63a5\u6536\u8005\u81ea\u5df1\u731c\u7f3a\u5931\u7684\u6587\u4ef6\u540d\u548c\u6267\u884c\u987a\u5e8f\u3002<\/p>\n<p>\u5bf9\u771f\u5b9e\u751f\u4fe1\u9879\u76ee\uff0c\u8fd8\u5e94\u8bb0\u5f55\u53c2\u8003\u57fa\u56e0\u7ec4\u7248\u672c\u3001\u6ce8\u91ca\u6765\u6e90\u3001\u6570\u636e\u9884\u5904\u7406\u8fc7\u7a0b\u4ee5\u53ca\u5173\u952e\u53c2\u6570\u3002\u5982\u679c\u8fd9\u4e9b\u4e1c\u897f\u53d1\u751f\u53d8\u5316\uff0c\u5373\u4f7f\u8f6f\u4ef6\u5305\u5b8c\u5168\u4e00\u81f4\uff0c\u8f93\u51fa\u4e5f\u53ef\u80fd\u4e0d\u540c\u3002\u5bf9\u4e8e\u65e0\u6cd5\u5171\u4eab\u7684\u539f\u59cb\u6570\u636e\uff0c\u53ef\u4ee5\u63d0\u4f9b\u4e0d\u542b\u654f\u611f\u4fe1\u606f\u7684\u5c0f\u6837\u4f8b\uff0c\u7528\u6765\u9a8c\u8bc1\u5b89\u88c5\u548c\u8f93\u5165\u8f93\u51fa\u683c\u5f0f\uff0c\u53e6\u884c\u7ea6\u5b9a\u6b63\u5f0f\u6570\u636e\u7684\u4ea4\u4ed8\u65b9\u5f0f\u3002<\/p>\n<p>\u73af\u5883\u6587\u4ef6\u4e5f\u9700\u8981\u968f\u7740\u9879\u76ee\u53d8\u66f4\u7ef4\u62a4\u3002\u67d0\u6b21\u589e\u52a0\u4f9d\u8d56\u540e\uff0c\u53ca\u65f6\u66f4\u65b0\u9700\u6c42\u8bf4\u660e\uff0c\u5e76\u5728\u65b0\u73af\u5883\u91cc\u91cd\u65b0\u8dd1\u6837\u4f8b\uff1b\u67d0\u6b21\u79fb\u9664\u4f9d\u8d56\u540e\uff0c\u68c0\u67e5\u811a\u672c\u662f\u5426\u8fd8\u6709\u9690\u5f0f\u8c03\u7528\u3002\u8fd9\u6837\u9879\u76ee\u8bf4\u660e\u624d\u80fd\u53cd\u6620\u5f53\u524d\u53ef\u8fd0\u884c\u72b6\u6001\uff0c\u907f\u514d\u79ef\u7d2f\u5927\u91cf\u201c\u4ee5\u524d\u53ef\u80fd\u7528\u8fc7\u201d\u7684\u5305\u3002<\/p>\n<p>\u4e0b\u4e00\u7bc7\u4f1a\u628a\u8fd9\u4e9b\u6587\u4ef6\u7ec4\u7ec7\u6210\u4e00\u4e2a\u53ef\u4ee5\u53cd\u590d\u542f\u52a8\u7684\u4efb\u52a1\uff0c\u663e\u5f0f\u8bbe\u7f6e\u73af\u5883\u3001\u5de5\u4f5c\u76ee\u5f55\u3001\u65e5\u5fd7\u548c\u5931\u8d25\u9000\u51fa\u3002\u82e5\u4f60\u9700\u8981\u628a\u4e2a\u4eba\u5206\u6790\u8f6c\u6210\u8bfe\u9898\u7ec4\u53ef\u5171\u4eab\u7684\u8fd0\u884c\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5148\u6574\u7406\u5f53\u524d\u9879\u76ee\u7684\u4f9d\u8d56\u4e0e\u9a8c\u6536\u6837\u4f8b\uff0c\u518d<a href=\"https:\/\/work.weixin.qq.com\/kfid\/kfcb05492f29d4d6064\">\u8054\u7cfb\u4e91\u751f\u4fe1\u54a8\u8be2\u670d\u52a1\u5668\u73af\u5883\u65b9\u6848<\/a>\u3002<\/p>\n<nav aria-label=\"Conda\u7cfb\u5217\u5bfc\u822a\" style=\"margin-top:36px;padding:20px;background:#eef8f4;border-radius:12px\">\n<h2>Conda \u4f7f\u7528\u6280\u5de7\u7cfb\u5217\u76ee\u5f55<\/h2>\n<p>\u5168\u7cfb\u5217\u6309\u5317\u4eac\u65f6\u95f4\u6bcf\u5929\u4e0a\u5348 9 \u70b9\u9646\u7eed\u5f00\u653e\u3002\u540e\u7eed\u7bc7\u7ae0\u8bf7\u5728\u6807\u6ce8\u65e5\u671f\u4e0a\u7ebf\u540e\u9605\u8bfb\u3002<\/p>\n<ol>\n<li><a href=\"https:\/\/www.biocloudservice.com\/wordpress\/?p=73352\">Conda \u4f7f\u7528\u6280\u5de7\uff08\u4e00\uff09\uff1a\u4ece\u96f6\u521b\u5efa\u72ec\u7acb\u73af\u5883\uff0c\u8dd1\u901a\u7b2c\u4e00\u4e2a\u5e8f\u5217\u7edf\u8ba1\u811a\u672c<\/a>\uff0811-17 09:00\uff09<\/li>\n<li><a href=\"https:\/\/www.biocloudservice.com\/wordpress\/?p=73353\">Conda \u4f7f\u7528\u6280\u5de7\uff08\u4e8c\uff09\uff1a\u8f6f\u4ef6\u5e94\u8be5\u4ece\u54ea\u91cc\u88c5\uff1f\u5f04\u61c2\u6e20\u9053\u3001\u7248\u672c\u4e0e pip<\/a>\uff0811-18 09:00\uff09<\/li>\n<li><a href=\"https:\/\/www.biocloudservice.com\/wordpress\/?p=73354\">Conda \u4f7f\u7528\u6280\u5de7\uff08\u4e09\uff09\uff1a\u88c5\u597d\u4e86\u8fd8\u662f\u62a5\u9519\uff1f\u6309\u987a\u5e8f\u89e3\u51b3\u73af\u5883\u3001\u4f9d\u8d56\u548c\u7f51\u7edc\u95ee\u9898<\/a>\uff0811-19 09:00\uff09<\/li>\n<li><a href=\"https:\/\/www.biocloudservice.com\/wordpress\/?p=73355\">Conda \u4f7f\u7528\u6280\u5de7\uff08\u56db\uff09\uff1a\u73af\u5883\u914d\u597d\u540e\u600e\u4e48\u4fdd\u5b58\uff1f\u4ece environment.yml \u5230\u590d\u73b0\u9a8c\u6536<\/a>\uff0811-20 09:00\uff09<\/li>\n<li><a href=\"https:\/\/www.biocloudservice.com\/wordpress\/?p=73356\">Conda \u4f7f\u7528\u6280\u5de7\uff08\u4e94\uff09\uff1a\u7ec8\u7aef\u80fd\u8dd1\uff0c\u811a\u672c\u4e5f\u8981\u80fd\u8dd1\u2014\u2014\u73af\u5883\u3001\u65e5\u5fd7\u4e0e\u65e5\u5e38\u7ef4\u62a4<\/a>\uff0811-21 09:00\uff09<\/li>\n<\/ol>\n<\/nav>\n<p><a href=\"https:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/conda-series-20261116-conda-lab-examples.zip\">\u4e0b\u8f7d\u5168\u7cfb\u5217\u7ec3\u4e60\u4ee3\u7801\u3001\u793a\u4f8b\u6570\u636e\u4e0e\u73af\u5883\u6587\u4ef6<\/a>\uff08ZIP\uff1b\u542b\u64cd\u4f5c\u8bf4\u660e\u4e0e\u9884\u671f\u8f93\u51fa\uff09<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u7ecf\u8fc7\u524d\u4e09\u7bc7\uff0c\u4f60\u5df2\u7ecf\u80fd\u521b\u5efa\u73af\u5883\u3001\u5b89\u88c5Biopython\uff0c\u5e76\u5904\u7406\u5e38\u89c1\u7684\u8fd0\u884c\u9519\u8bef\u3002\u63a5\u4e0b\u6765\u4f1a\u51fa\u73b0\u4e00\u4e2a\u66f4\u5b9e\u9645\u7684\u95ee\u9898\uff1a\u6362\u4e00\u53f0\u7535\u8111\u3001\u4ea4\u7ed9\u540c\u4e8b\uff0c\u6216\u8005\u534a\u5e74\u4ee5\u540e\u518d\u505a\u4e00\u904d\uff0c\u600e\u6837\u77e5\u9053\u81ea\u5df1\u4f7f\u7528\u7684\u8fd8\u662f\u90a3\u5957\u8f6f\u4ef6\uff1f\u53ea\u5199\u4e00\u53e5\u201c\u9700\u8981Python\u548cBiopython\u201d\uff0c\u901a\u5e38\u65e0\u6cd5\u89e3\u91ca\u7248\u672c\u3001\u6e20\u9053\u548c\u5e73\u53f0\u4e4b\u95f4\u7684\u5dee\u5f02\u3002<\/p>\n","protected":false},"author":1,"featured_media":73367,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[49,75],"tags":[1465,1466,1467,172],"class_list":["post-73355","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","category-compute-environment","tag-conda","tag-1467","tag-172"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/conda-series-20261116-figure-07.png?fit=1400%2C900&ssl=1","_links":{"self":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/73355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/comments?post=73355"}],"version-history":[{"count":1,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/73355\/revisions"}],"predecessor-version":[{"id":73369,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/73355\/revisions\/73369"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media\/73367"}],"wp:attachment":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media?parent=73355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/categories?post=73355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/tags?post=73355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}