{"id":39385,"date":"2025-05-23T15:41:37","date_gmt":"2025-05-23T07:41:37","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/39385.html"},"modified":"2025-05-23T15:41:37","modified_gmt":"2025-05-23T07:41:37","slug":"%e7%a6%bb%e7%ba%bf%e6%9c%8d%e5%8a%a1%e5%99%a8python%e7%8e%af%e5%a2%83%e9%85%8d%e7%bd%ae%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/39385.html","title":{"rendered":"\u79bb\u7ebf\u670d\u52a1\u5668Python\u73af\u5883\u914d\u7f6e\u6307\u5357"},"content":{"rendered":"<h2>\u79bb\u7ebf\u670d\u52a1\u5668Python\u73af\u5883\u914d\u7f6e\u6307\u5357&#xff1a;\u907f\u5751\u4e0e\u5b9e\u6218<\/h2>\n<h3>0. \u573a\u666f\u5206\u6790&#xff1a;\u5f53\u670d\u52a1\u5668\u4e0e\u4e16\u9694\u7edd\u65f6<\/h3>\n<p>\u5178\u578b\u56f0\u5883&#xff1a;<\/p>\n<ul>\n<li>\u65e0\u6cd5\u8bbf\u95ee\u56fd\u9645\u7f51\u7edc&#xff08;\u5982PyPI\u3001Conda\u5b98\u65b9\u6e90&#xff09;<\/li>\n<li>\u670d\u52a1\u5668\u5904\u4e8e\u5185\u7f51\u9694\u79bb\u73af\u5883<\/li>\n<li>\u5b89\u5168\u7b56\u7565\u9650\u5236\u5728\u7ebf\u5b89\u88c5<\/li>\n<\/ul>\n<p>\u89e3\u51b3\u65b9\u6848\u77e9\u9635&#xff1a;<\/p>\n<table>\n<tr>\u65b9\u6cd5\u9002\u7528\u573a\u666f\u4f18\u70b9\u7f3a\u70b9<\/tr>\n<tbody>\n<tr>\n<td>Wheel\u79bb\u7ebf\u5b89\u88c5<\/td>\n<td>\u5c0f\u578b\u9879\u76ee\/\u5c11\u91cf\u4f9d\u8d56<\/td>\n<td>\u7cbe\u786e\u63a7\u5236\u4f9d\u8d56\u7248\u672c<\/td>\n<td>\u9700\u624b\u52a8\u89e3\u51b3\u4f9d\u8d56\u6811<\/td>\n<\/tr>\n<tr>\n<td>Conda Pack\u6253\u5305<\/td>\n<td>\u4e2d\u578b\u9879\u76ee\/Conda\u73af\u5883<\/td>\n<td>\u5b8c\u6574\u73af\u5883\u514b\u9686<\/td>\n<td>\u73af\u5883\u8def\u5f84\u9700\u4e00\u81f4<\/td>\n<\/tr>\n<tr>\n<td>Docker\u955c\u50cf<\/td>\n<td>\u590d\u6742\u9879\u76ee\/\u7cfb\u7edf\u7ea7\u4f9d\u8d56<\/td>\n<td>\u5b8c\u5168\u73af\u5883\u9694\u79bb<\/td>\n<td>\u9700\u8981Docker\u57fa\u7840<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>1. Conda\u4e0ePip\u751f\u5b58\u624b\u518c<\/h3>\n<h4>1.1 \u865a\u62df\u73af\u5883&#xff1a;\u4f60\u7684\u4ee3\u7801\u5b89\u5168\u5c4b<\/h4>\n<p>\u76f4\u89c2\u8ba4\u77e5&#xff1a;<\/p>\n<ul>\n<li>\u60f3\u8c61\u4f60\u5728\u540c\u65f6\u5f00\u53d1\u4e24\u4e2a\u9879\u76ee&#xff1a;\n<ul>\n<li>\u9879\u76eeA\u9700\u8981Python 3.6 &#043; TensorFlow 1.x<\/li>\n<li>\u9879\u76eeB\u9700\u8981Python 3.9 &#043; TensorFlow 2.x<\/li>\n<\/ul>\n<\/li>\n<li>\u865a\u62df\u73af\u5883\u5c31\u50cf\u9694\u79bb\u7684\u96c6\u88c5\u7bb1&#xff0c;\u8ba9\u4e0d\u540c\u9879\u76ee\u4f9d\u8d56\u4e92\u4e0d\u5e72\u6270<\/li>\n<\/ul>\n<p>Conda vs Virtualenv&#xff1a;<\/p>\n<p><span class=\"token comment\"># Conda\u53ef\u7ba1\u7406Python\u7248\u672c\u548c\u975ePython\u4f9d\u8d56&#xff08;\u5982CUDA&#xff09;<\/span><br \/>\nconda create <span class=\"token parameter variable\">-n<\/span> py36 <span class=\"token assign-left variable\">python<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">3.6<\/span> <span class=\"token assign-left variable\">cudatoolkit<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">10.2<\/span><\/p>\n<p><span class=\"token comment\"># Virtualenv\u4ec5\u7ba1\u7406Python\u5305<\/span><br \/>\nvirtualenv venv <span class=\"token parameter variable\">&#8211;python<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">3.6<\/span><\/p>\n<h4>1.2 \u4e3a\u4ec0\u4e48\u9700\u8981\u5b83\u4eec&#xff1f;<\/h4>\n<ul>\n<li>\u4f9d\u8d56\u51b2\u7a81\u9884\u9632&#xff1a;\u907f\u514d\u5728\u6211\u7684\u7535\u8111\u4e0a\u53ef\u4ee5\u8dd1&#xff0c;\u6362\u4e00\u53f0\u7535\u8111\u5c31\u4e0d\u884c\u4e86<\/li>\n<li>\u73af\u5883\u53ef\u590d\u73b0&#xff1a;\u7cbe\u51c6\u63a7\u5236\u6bcf\u4e2a\u9879\u76ee\u7684\u4f9d\u8d56\u7248\u672c<\/li>\n<li>\u6743\u9650\u89c4\u907f&#xff1a;\u65e0\u9700sudo\u6743\u9650\u5b89\u88c5\u8f6f\u4ef6\u5305<\/li>\n<\/ul>\n<h4>1.3 \u9ad8\u624b\u8fdb\u9636\u6307\u5357<\/h4>\n<h5>1.3.1 Conda\u95ea\u7535\u5165\u95e8<\/h5>\n<p><span class=\"token comment\"># \u521b\u5efa\u73af\u5883<\/span><br \/>\nconda create <span class=\"token parameter variable\">-n<\/span> lab_env <span class=\"token assign-left variable\">python<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">3.8<\/span><\/p>\n<p><span class=\"token comment\"># \u6fc0\u6d3b\u73af\u5883<\/span><br \/>\nconda activate lab_env<\/p>\n<p><span class=\"token comment\"># \u641c\u7d22\u5305<\/span><br \/>\nconda search tensorflow<\/p>\n<p><span class=\"token comment\"># \u5b89\u88c5\u5305&#xff08;\u4f18\u5148\u4eceConda\u6e90\u83b7\u53d6&#xff09;<\/span><br \/>\nconda <span class=\"token function\">install<\/span> tensorflow-gpu<span class=\"token operator\">&#061;<\/span><span class=\"token number\">2.4<\/span>.1<\/p>\n<p><span class=\"token comment\"># \u5bfc\u51fa\u73af\u5883\u914d\u7f6e<\/span><br \/>\nconda <span class=\"token function\">env<\/span> <span class=\"token builtin class-name\">export<\/span> <span class=\"token operator\">&gt;<\/span> environment.yml<\/p>\n<p><span class=\"token comment\"># \u514b\u9686\u73af\u5883<\/span><br \/>\nconda create <span class=\"token parameter variable\">&#8211;clone<\/span> lab_env <span class=\"token parameter variable\">&#8211;name<\/span> backup_env<\/p>\n<h5>1.3.2 Pip\u9ad8\u6548\u4f7f\u7528\u6280\u5de7<\/h5>\n<p>\u955c\u50cf\u52a0\u901f&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u4f7f\u7528\u6e05\u534e\u6e90<\/span><br \/>\npip <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-i<\/span> https:\/\/pypi.tuna.tsinghua.edu.cn\/simple package_name<\/p>\n<p><span class=\"token comment\"># \u6c38\u4e45\u914d\u7f6e<\/span><br \/>\npip config <span class=\"token builtin class-name\">set<\/span> global.index-url https:\/\/mirrors.aliyun.com\/pypi\/simple\/<\/p>\n<p>\u4f9d\u8d56\u89e3\u6790\u539f\u7406&#xff1a;<\/p>\n<li>\u4e0b\u8f7d\u5305\u5143\u6570\u636e<\/li>\n<li>\u6784\u5efa\u4f9d\u8d56\u5173\u7cfb\u6811<\/li>\n<li>\u5bfb\u627e\u7248\u672c\u517c\u5bb9\u89e3<\/li>\n<li>\u4e0b\u8f7dwhl\u6587\u4ef6<\/li>\n<li>\u5b89\u88c5\u5e76\u9a8c\u8bc1<\/li>\n<h5>1.3.3 Conda Pack\u73af\u5883\u8fc1\u79fb\u672f<\/h5>\n<p><span class=\"token comment\"># \u5b89\u88c5\u6253\u5305\u5de5\u5177<\/span><br \/>\nconda <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-c<\/span> conda-forge conda-pack<\/p>\n<p><span class=\"token comment\"># \u6253\u5305\u73af\u5883&#xff08;-n\u6307\u5b9a\u73af\u5883\u540d&#xff0c;-o\u8f93\u51fa\u6587\u4ef6&#xff09;<\/span><br \/>\nconda pack <span class=\"token parameter variable\">-n<\/span> lab_env <span class=\"token parameter variable\">-o<\/span> lab_env.tar.gz<\/p>\n<p><span class=\"token comment\"># \u5728\u76ee\u6807\u670d\u52a1\u5668<\/span><br \/>\n<span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> \/opt\/envs<br \/>\n<span class=\"token function\">tar<\/span> <span class=\"token parameter variable\">-xzf<\/span> lab_env.tar.gz <span class=\"token parameter variable\">-C<\/span> \/opt\/envs<br \/>\n<span class=\"token builtin class-name\">source<\/span> \/opt\/envs\/bin\/activate<\/p>\n<p><span class=\"token comment\"># \u9a8c\u8bc1\u8def\u5f84<\/span><br \/>\n<span class=\"token function\">which<\/span> python  <span class=\"token comment\"># \u5e94\u663e\u793a\/opt\/envs\/bin\/python<\/span><\/p>\n<p>\u6ce8\u610f&#xff1a;\u76ee\u6807\u670d\u52a1\u5668\u7684Python\u57fa\u7840\u7248\u672c\u9700\u4e0e\u6e90\u73af\u5883\u4e00\u81f4<\/p>\n<hr \/>\n<h3>2. \u7ec8\u6781\u65b9\u6848&#xff1a;Docker\u5bb9\u5668\u5316\u90e8\u7f72<\/h3>\n<h4>2.1 \u4e3a\u4ec0\u4e48\u9700\u8981Docker&#xff1f;<\/h4>\n<ul>\n<li>\u89e3\u51b3\u7cfb\u7edf\u7ea7\u4f9d\u8d56\u95ee\u9898&#xff08;\u5982glibc\u7248\u672c&#xff09;<\/li>\n<li>\u5b9e\u73b0\u771f\u6b63\u7684\u73af\u5883\u4e00\u81f4\u6027<\/li>\n<li>\u89c4\u907f&#034;\u5728\u6211\u7684\u673a\u5668\u80fd\u8dd1&#034;\u7684\u5669\u68a6<\/li>\n<\/ul>\n<h4>2.2 Docker\u5b9e\u6218\u4e03\u6b65\u66f2<\/h4>\n<li>\u672c\u5730\u5f00\u53d1Dockerfile&#xff1a;<\/li>\n<p>FROM nvidia\/cuda:11.3.1-cudnn8-runtime-ubuntu20.04<\/p>\n<p># \u8bbe\u7f6e\u6e05\u534e\u955c\u50cf\u6e90<br \/>\nRUN sed -i &#039;s\/archive.ubuntu.com\/mirrors.tuna.tsinghua.edu.cn\/g&#039; \/etc\/apt\/sources.list<\/p>\n<p># \u5b89\u88c5\u57fa\u7840\u4f9d\u8d56<br \/>\nRUN apt-get update &amp;&amp; \\\\<br \/>\n    apt-get install -y python3.8 python3-pip &amp;&amp; \\\\<br \/>\n    ln -s \/usr\/bin\/python3.8 \/usr\/bin\/python<\/p>\n<p># \u590d\u5236\u73af\u5883\u914d\u7f6e<br \/>\nCOPY requirements.txt \/app\/<br \/>\nWORKDIR \/app<\/p>\n<p># \u5b89\u88c5Python\u4f9d\u8d56<br \/>\nRUN pip install -i https:\/\/pypi.tuna.tsinghua.edu.cn\/simple -r requirements.txt<\/p>\n<p># \u62f7\u8d1d\u6e90\u4ee3\u7801<br \/>\nCOPY . \/app<\/p>\n<p>CMD [&#034;python&#034;, &#034;main.py&#034;]<\/p>\n<li>\u6784\u5efa\u955c\u50cf&#xff1a;<\/li>\n<p><span class=\"token function\">docker<\/span> build <span class=\"token parameter variable\">-t<\/span> myapp:1.0 <span class=\"token builtin class-name\">.<\/span><\/p>\n<li>\u4fdd\u5b58\u955c\u50cf&#xff1a;<\/li>\n<p><span class=\"token function\">docker<\/span> save myapp:1.0 <span class=\"token operator\">&gt;<\/span> myapp.tar<\/p>\n<li>\u4f20\u8f93\u5230\u670d\u52a1\u5668&#xff1a;<\/li>\n<p><span class=\"token function\">scp<\/span> myapp.tar user&#064;server:\/path\/<\/p>\n<li>\u670d\u52a1\u5668\u52a0\u8f7d\u955c\u50cf&#xff1a;<\/li>\n<p><span class=\"token function\">docker<\/span> load <span class=\"token operator\">&lt;<\/span> myapp.tar<\/p>\n<li>\u542f\u52a8\u5bb9\u5668&#xff08;\u793a\u4f8b\u5e26GPU\u652f\u6301&#xff09;&#xff1a;<\/li>\n<p><span class=\"token function\">docker<\/span> run <span class=\"token parameter variable\">&#8211;gpus<\/span> all <span class=\"token parameter variable\">-it<\/span> myapp:1.0<\/p>\n<li>\u9a8c\u8bc1\u73af\u5883&#xff1a;<\/li>\n<p><span class=\"token function\">docker<\/span> <span class=\"token builtin class-name\">exec<\/span> <span class=\"token parameter variable\">-it<\/span> <span class=\"token punctuation\">[<\/span>CONTAINER_ID<span class=\"token punctuation\">]<\/span> python <span class=\"token parameter variable\">-c<\/span> <span class=\"token string\">&#034;import tensorflow as tf; print(tf.config.list_physical_devices(&#039;GPU&#039;))&#034;<\/span><\/p>\n<hr \/>\n<h3>4. \u65b9\u6848\u9009\u578b\u51b3\u7b56\u6811<\/h3>\n<p>  #mermaid-svg-V8PggeQk4jqpFhmN {font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-V8PggeQk4jqpFhmN .error-icon{fill:#552222;}#mermaid-svg-V8PggeQk4jqpFhmN .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-V8PggeQk4jqpFhmN .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-V8PggeQk4jqpFhmN .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-V8PggeQk4jqpFhmN .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-V8PggeQk4jqpFhmN .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-V8PggeQk4jqpFhmN .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-V8PggeQk4jqpFhmN .marker{fill:#333333;stroke:#333333;}#mermaid-svg-V8PggeQk4jqpFhmN .marker.cross{stroke:#333333;}#mermaid-svg-V8PggeQk4jqpFhmN svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-V8PggeQk4jqpFhmN .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-V8PggeQk4jqpFhmN .cluster-label text{fill:#333;}#mermaid-svg-V8PggeQk4jqpFhmN .cluster-label span{color:#333;}#mermaid-svg-V8PggeQk4jqpFhmN .label text,#mermaid-svg-V8PggeQk4jqpFhmN span{fill:#333;color:#333;}#mermaid-svg-V8PggeQk4jqpFhmN .node rect,#mermaid-svg-V8PggeQk4jqpFhmN .node circle,#mermaid-svg-V8PggeQk4jqpFhmN .node ellipse,#mermaid-svg-V8PggeQk4jqpFhmN .node polygon,#mermaid-svg-V8PggeQk4jqpFhmN .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-V8PggeQk4jqpFhmN .node .label{text-align:center;}#mermaid-svg-V8PggeQk4jqpFhmN .node.clickable{cursor:pointer;}#mermaid-svg-V8PggeQk4jqpFhmN .arrowheadPath{fill:#333333;}#mermaid-svg-V8PggeQk4jqpFhmN .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-V8PggeQk4jqpFhmN .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-V8PggeQk4jqpFhmN .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid-svg-V8PggeQk4jqpFhmN .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid-svg-V8PggeQk4jqpFhmN .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-V8PggeQk4jqpFhmN .cluster text{fill:#333;}#mermaid-svg-V8PggeQk4jqpFhmN .cluster span{color:#333;}#mermaid-svg-V8PggeQk4jqpFhmN div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-V8PggeQk4jqpFhmN :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;} <\/p>\n<p>         <span id=\"L-L-A-B\" class=\"edgeLabel L-LS-A&#039; L-LE-B\"><\/span> <\/p>\n<p>         <span id=\"L-L-B-C\" class=\"edgeLabel L-LS-B&#039; L-LE-C\">\u5426<\/span> <\/p>\n<p>         <span id=\"L-L-B-D\" class=\"edgeLabel L-LS-B&#039; L-LE-D\">\u662f<\/span> <\/p>\n<p>         <span id=\"L-L-C-E\" class=\"edgeLabel L-LS-C&#039; L-LE-E\">\u662f<\/span> <\/p>\n<p>         <span id=\"L-L-C-F\" class=\"edgeLabel L-LS-C&#039; L-LE-F\">\u5426<\/span> <\/p>\n<p>         <span id=\"L-L-D-G\" class=\"edgeLabel L-LS-D&#039; L-LE-G\"><\/span> <\/p>\n<p>         <span id=\"L-L-E-G\" class=\"edgeLabel L-LS-E&#039; L-LE-G\"><\/span> <\/p>\n<p>         <span id=\"L-L-F-G\" class=\"edgeLabel L-LS-F&#039; L-LE-G\"><\/span> <\/p>\n<p>           \u9700\u8981\u914d\u7f6e\u73af\u5883 <\/p>\n<p>           \u662f\u5426\u9700\u8981\u7cfb\u7edf\u7ea7\u4f9d\u8d56? <\/p>\n<p>           \u4f9d\u8d56\u6570\u91cf\u662f\u5426\u8f83\u5c11? <\/p>\n<p>           Docker\u65b9\u6848 <\/p>\n<p>           Wheel\u79bb\u7ebf\u5b89\u88c5 <\/p>\n<p>           Conda Pack <\/p>\n<p>           \u5b8c\u6210 <\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e15\u6b21\uff0c\u6536\u85cf24\u6b21\u3002\u5728\u79bb\u7ebf\u670d\u52a1\u5668\u4e0a\u914d\u7f6ePython\u73af\u5883\u65f6\uff0c\u9762\u4e34\u7684\u4e3b\u8981\u6311\u6218\u5305\u62ec\u65e0\u6cd5\u8bbf\u95ee\u56fd\u9645\u7f51\u7edc\u3001\u5185\u7f51\u9694\u79bb\u548c\u5b89\u5168\u7b56\u7565\u9650\u5236\u3002\u9488\u5bf9\u8fd9\u4e9b\u56f0\u5883\uff0c\u672c\u6587\u63d0\u4f9b\u4e86\u4e09\u79cd\u4e3b\u8981\u89e3\u51b3\u65b9\u6848\uff1aWheel\u79bb\u7ebf\u5b89\u88c5\u3001Conda Pack\u6253\u5305\u548cDocker\u955c\u50cf\u3002Wheel\u9002\u7528\u4e8e\u5c0f\u578b\u9879\u76ee\uff0cConda Pack\u9002\u5408\u4e2d\u578b\u9879\u76ee\uff0c\u800cDocker\u5219\u9002\u7528\u4e8e\u590d\u6742\u9879\u76ee\u3002\u6587\u7ae0\u8be6\u7ec6\u4ecb\u7ecd\u4e86Conda\u548cPip\u7684\u4f7f\u7528\u6280\u5de7\uff0c\u5305\u62ec\u865a\u62df\u73af\u5883\u7684\u521b\u5efa\u4e0e\u7ba1\u7406\u3001\u4f9d\u8d56\u51b2\u7a81\u7684\u9884\u9632\u3001\u73af\u5883\u53ef\u590d\u73b0\u6027\u4ee5\u53ca\u6743\u9650\u89c4\u907f\u3002\u6b64\u5916\uff0c\u8fd8\u63d0\u4f9b\u4e86Conda Pack\u73af\u5883\u8fc1\u79fb\u548cDocker\u5bb9\u5668\u5316\u90e8\u7f72\u7684\u5b9e\u6218\u6b65\u9aa4\uff0c\u5e2e\u52a9\u7528\u6237\u5728\u4e0d\u540c\u573a\u666f\u4e0b\u9009\u62e9\u6700<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3527,81,43,44],"topic":[],"class_list":["post-39385","post","type-post","status-publish","format-standard","hentry","category-server","tag-ai-","tag-python","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u79bb\u7ebf\u670d\u52a1\u5668Python\u73af\u5883\u914d\u7f6e\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/39385.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u79bb\u7ebf\u670d\u52a1\u5668Python\u73af\u5883\u914d\u7f6e\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e15\u6b21\uff0c\u6536\u85cf24\u6b21\u3002\u5728\u79bb\u7ebf\u670d\u52a1\u5668\u4e0a\u914d\u7f6ePython\u73af\u5883\u65f6\uff0c\u9762\u4e34\u7684\u4e3b\u8981\u6311\u6218\u5305\u62ec\u65e0\u6cd5\u8bbf\u95ee\u56fd\u9645\u7f51\u7edc\u3001\u5185\u7f51\u9694\u79bb\u548c\u5b89\u5168\u7b56\u7565\u9650\u5236\u3002\u9488\u5bf9\u8fd9\u4e9b\u56f0\u5883\uff0c\u672c\u6587\u63d0\u4f9b\u4e86\u4e09\u79cd\u4e3b\u8981\u89e3\u51b3\u65b9\u6848\uff1aWheel\u79bb\u7ebf\u5b89\u88c5\u3001Conda Pack\u6253\u5305\u548cDocker\u955c\u50cf\u3002Wheel\u9002\u7528\u4e8e\u5c0f\u578b\u9879\u76ee\uff0cConda Pack\u9002\u5408\u4e2d\u578b\u9879\u76ee\uff0c\u800cDocker\u5219\u9002\u7528\u4e8e\u590d\u6742\u9879\u76ee\u3002\u6587\u7ae0\u8be6\u7ec6\u4ecb\u7ecd\u4e86Conda\u548cPip\u7684\u4f7f\u7528\u6280\u5de7\uff0c\u5305\u62ec\u865a\u62df\u73af\u5883\u7684\u521b\u5efa\u4e0e\u7ba1\u7406\u3001\u4f9d\u8d56\u51b2\u7a81\u7684\u9884\u9632\u3001\u73af\u5883\u53ef\u590d\u73b0\u6027\u4ee5\u53ca\u6743\u9650\u89c4\u907f\u3002\u6b64\u5916\uff0c\u8fd8\u63d0\u4f9b\u4e86Conda Pack\u73af\u5883\u8fc1\u79fb\u548cDocker\u5bb9\u5668\u5316\u90e8\u7f72\u7684\u5b9e\u6218\u6b65\u9aa4\uff0c\u5e2e\u52a9\u7528\u6237\u5728\u4e0d\u540c\u573a\u666f\u4e0b\u9009\u62e9\u6700\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/39385.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-23T07:41:37+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/39385.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/39385.html\",\"name\":\"\u79bb\u7ebf\u670d\u52a1\u5668Python\u73af\u5883\u914d\u7f6e\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-23T07:41:37+00:00\",\"dateModified\":\"2025-05-23T07:41:37+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/39385.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/39385.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/39385.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u79bb\u7ebf\u670d\u52a1\u5668Python\u73af\u5883\u914d\u7f6e\u6307\u5357\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u79bb\u7ebf\u670d\u52a1\u5668Python\u73af\u5883\u914d\u7f6e\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/39385.html","og_locale":"zh_CN","og_type":"article","og_title":"\u79bb\u7ebf\u670d\u52a1\u5668Python\u73af\u5883\u914d\u7f6e\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e15\u6b21\uff0c\u6536\u85cf24\u6b21\u3002\u5728\u79bb\u7ebf\u670d\u52a1\u5668\u4e0a\u914d\u7f6ePython\u73af\u5883\u65f6\uff0c\u9762\u4e34\u7684\u4e3b\u8981\u6311\u6218\u5305\u62ec\u65e0\u6cd5\u8bbf\u95ee\u56fd\u9645\u7f51\u7edc\u3001\u5185\u7f51\u9694\u79bb\u548c\u5b89\u5168\u7b56\u7565\u9650\u5236\u3002\u9488\u5bf9\u8fd9\u4e9b\u56f0\u5883\uff0c\u672c\u6587\u63d0\u4f9b\u4e86\u4e09\u79cd\u4e3b\u8981\u89e3\u51b3\u65b9\u6848\uff1aWheel\u79bb\u7ebf\u5b89\u88c5\u3001Conda Pack\u6253\u5305\u548cDocker\u955c\u50cf\u3002Wheel\u9002\u7528\u4e8e\u5c0f\u578b\u9879\u76ee\uff0cConda Pack\u9002\u5408\u4e2d\u578b\u9879\u76ee\uff0c\u800cDocker\u5219\u9002\u7528\u4e8e\u590d\u6742\u9879\u76ee\u3002\u6587\u7ae0\u8be6\u7ec6\u4ecb\u7ecd\u4e86Conda\u548cPip\u7684\u4f7f\u7528\u6280\u5de7\uff0c\u5305\u62ec\u865a\u62df\u73af\u5883\u7684\u521b\u5efa\u4e0e\u7ba1\u7406\u3001\u4f9d\u8d56\u51b2\u7a81\u7684\u9884\u9632\u3001\u73af\u5883\u53ef\u590d\u73b0\u6027\u4ee5\u53ca\u6743\u9650\u89c4\u907f\u3002\u6b64\u5916\uff0c\u8fd8\u63d0\u4f9b\u4e86Conda Pack\u73af\u5883\u8fc1\u79fb\u548cDocker\u5bb9\u5668\u5316\u90e8\u7f72\u7684\u5b9e\u6218\u6b65\u9aa4\uff0c\u5e2e\u52a9\u7528\u6237\u5728\u4e0d\u540c\u573a\u666f\u4e0b\u9009\u62e9\u6700","og_url":"https:\/\/www.wsisp.com\/helps\/39385.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-23T07:41:37+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/39385.html","url":"https:\/\/www.wsisp.com\/helps\/39385.html","name":"\u79bb\u7ebf\u670d\u52a1\u5668Python\u73af\u5883\u914d\u7f6e\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-23T07:41:37+00:00","dateModified":"2025-05-23T07:41:37+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/39385.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/39385.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/39385.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u79bb\u7ebf\u670d\u52a1\u5668Python\u73af\u5883\u914d\u7f6e\u6307\u5357"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/39385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=39385"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/39385\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=39385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=39385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=39385"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=39385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}