{"id":229378,"date":"2020-12-11T11:37:31","date_gmt":"2020-12-11T03:37:31","guid":{"rendered":"http:\/\/4563.org\/?p=229378"},"modified":"2020-12-11T11:37:31","modified_gmt":"2020-12-11T03:37:31","slug":"%e6%9c%89%e5%af%b9%e8%99%9a%e6%8b%9f%e7%8e%af%e5%a2%83%e7%86%9f%e6%82%89%e7%9a%84%e5%a4%a7%e4%bd%ac%e5%90%97","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=229378","title":{"rendered":"\u6709\u5bf9\u865a\u62df\u73af\u5883\u719f\u6089\u7684\u5927\u4f6c\u5417"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6709\u5bf9\u865a\u62df\u73af\u5883\u719f\u6089\u7684\u5927\u4f6c\u5417               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : IVeverKB <\/span>  <span><i><\/i> 7<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u865a\u62df\u73af\u5883\u662f\u76f4\u63a5\u7528 python \u81ea\u5e26\u7684 venv \u547d\u4ee4\u88c5\u7684<\/p>\n<p>\u65e0\u7f51\u73af\u5883\uff0c\u5df2\u77e5\u865a\u62df\u73af\u5883 1 \u6709\u6211\u9700\u8981\u7684\u5305 A\uff0c\u865a\u62df\u73af\u5883 2 \u6ca1\u6709\uff0c\u90a3\u80fd\u4e0d\u80fd\u76f4\u63a5\u4ece\u865a\u62df\u73af\u5883 1 \u7684\u6587\u4ef6\u5939\u91cc\u627e\u5230\u5305 A \u5bf9\u5e94\u7684\u6587\u4ef6\u62f7\u8d1d\u5230\u865a\u62df\u73af\u5883 2 \u4e2d\u5462\uff0c\u5982\u679c\u53ef\u4ee5\u7684\u8bdd\u9700\u8981\u62f7\u8d1d\u54ea\u4e9b\u6587\u4ef6\uff1f<\/p>\n<p>\u53e6\uff0c\u5982\u679c\u6240\u9700\u7684\u65b0\u865a\u62df\u73af\u5883 python \u5305\u8ddf\u5df2\u6709\u7684\u865a\u62df\u73af\u5883 1 \u4e00\u6a21\u4e00\u6837\uff0c\u5728\u4e0d\u5171\u7528\u4e00\u4e2a\u865a\u62df\u73af\u5883\u7684\u524d\u63d0\u4e0b\uff0c\u6211\u662f\u5426\u80fd\u5c06\u865a\u62df\u73af\u5883 1 \u76f4\u63a5\u62f7\u8d1d\u5230\u6211\u60f3\u8981\u7684\u8def\u5f84\uff0c\u5e76\u4e14\u66f4\u6539\u865a\u62df\u73af\u5883\u6587\u4ef6\u5939\u7684\u540d\u5b57\uff1f\u6216\u8005\u9700\u8981\u505a\u54ea\u4e9b\u6539\u52a8\u624d\u80fd\u8fbe\u5230\u6211\u60f3\u8981\u7684\u6548\u679c\uff1f<\/p>\n<p>\u7f51\u4e0a\u627e\u7684\u4e00\u822c\u90fd\u662f\u7528 requirements.txt \u548c pip install\uff0c\u4f46\u6211\u73b0\u5728\u9047\u5230\u65e0\u7f51\u7684\u60c5\u51b5\uff0c\u671b\u6307\u70b9<\/p>\n<p>\u611f\u8c22<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>9<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4702131\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yuanxing008 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             pip install \u4e5f\u4e0d\u662f\u8bf4\u4e00\u5b9a\u8981\u7f51\u7edc\u7684 \u53ef\u4ee5\u88c5\u672c\u5730\u5305\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4702132\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 614457662 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u590d\u7528\u539f\u6765\u7684\u73af\u5883\u6709\u4ec0\u4e48\u95ee\u9898\u5417\uff1f\u65e2\u7136\u662f\u65e0\u7f51\u73af\u5883\uff0c\u4f60\u4ee3\u7801\u600e\u4e48\u4e0a\u53bb\u7684\u65f6\u5019\uff0c\u628a\u4f60\u9700\u8981\u7684 whl \u6587\u4ef6\u548c\u4ee3\u7801\u4e00\u8d77\u5e26\u4e0a\u53bb\uff0c\u5c31\u79bb\u7ebf\u5b89\u88c5\u4e5f\u53ef\u4ee5\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4702133\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : gstqc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             1. \u590d\u5236 venv\/lib\/python&lt;version&gt;\/site-packages\/&lt;package_name&gt;<br \/>2. \u540c\u4e00\u4e2a\u53d1\u884c\u7248\u53ef\u4ee5\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4702134\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : IVeverKB <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @yuanxing008 #1<br \/>@614457662 #2<br \/>\u672c\u5730\u5305\u662f\u6307 whl \u79bb\u7ebf\u5b89\u88c5\u5305\u5417\uff0c\u5176\u5b9e\u4e5f\u4e0d\u662f\u4e0d\u53ef\u4ee5\u4f46\u5bfc\u5165\u5bfc\u51fa\u8981\u7533\u8bf7\u8fc7\u7a0b\u9ebb\u70e6\u3002\u6240\u4ee5\u73b0\u5728\u95ee\u662f\u5426\u5728\u4e0d\u7528\u79bb\u7ebf\u5b89\u88c5\u5305\u7684\u60c5\u51b5\u4e0b\uff0c\u5c31\u662f\u4f7f\u7528\u539f\u6709\u865a\u62df\u73af\u5883\u6587\u4ef6\u5939\u7684\u8d44\u6e90\u5c31\u53ef\u4ee5\u590d\u7528\u4e00\u4e0b\u60f3\u8981\u7684\u5305\uff0c\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u7b80\u5316\u4e00\u4e0b\u7a0b\u5e8f\u5427\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4702135\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : YouLMAO <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Conda \u5927\u5e08\u6765\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4702136\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xia0pia0 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u9ed8\u8ba4\u662f\u5728 site-package \u4e0b\u9762\uff0c\u5176\u5b9e Python \u627e\u5305\u5c31\u662f\u4ece sys.path \u53bb\u627e\u7684\uff0c \u865a\u62df\u73af\u5883 1\uff1apython shell&gt; import sys print(sys.path)                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4702137\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : IVeverKB <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @gstqc #3 \u8c22\u8c22\u5c0f\u718a\u7ef4\u5c3c\uff01\uff01<br \/>@xia0pia0 #6 \u8c22\u8c22\u61c2\u4e86\uff01                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4702138\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : frostming <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4eb2\u53ef\u4ee5\u79bb\u7ebf\u5b89\u88c5\u7684\uff0c\u9996\u5148\u628a\u4f60\u6240\u6709\u7684\u4f9d\u8d56\u90fd\u751f\u6210\u5230 requirements.txt \u4e2d<\/p>\n<p>1. \u5728\u8054\u7f51\u7684\u673a\u5668\u4e2d\uff1apip download -r requirements.txt -d packages<br \/>2. \u628a requirements.txt \u4ee5\u53ca packages \u76ee\u5f55\u6574\u4e2a\u4f20\u5230\u53e6\u4e00\u4e2a\u65e0\u7f51\u7684\u673a\u5668\u4e0a<br \/>3. \u5728\u65e0\u7f51\u673a\u5668\u4e0a\u521b\u5efa\u597d\u865a\u62df\u73af\u5883\uff0c\u7136\u540e pip install -r requirements.txt -f packages                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4702139\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ClericPy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6700\u8fd1\u4e5f\u505a\u8fd9\u79cd\u591a\u673a\u53d1\u5e03\u7684\u6d3b, \u73b0\u5728\u7528\u81ea\u5e26 zipapp \u6253\u5305 pyz \u90a3\u4e2a\u534f\u8bae, \u53d1\u5e03\u65f6\u5019\u5c31\u662f\u63a8\u5230\u591a\u4e2a\u673a\u5668\u4e00\u8d77\u6302\u8f7d\u7684\u90a3\u4e2a nas \u4e0a, \u8fd0\u884c\u5c31\u76f4\u63a5 python3 xxx.pyz abc.py. \u6ca1\u6709 .so \/ .pyd \u90a3\u79cd\u52a8\u6001\u4f9d\u8d56\u7684\u60c5\u51b5\u4e0b, \u5355\u4e2a zip \u6587\u4ef6\u53d1\u5e03\u548c\u8fd0\u884c\u90fd\u5f88\u65b9\u4fbf, \u5c31\u7b97\u6709\u4e5f\u6ca1\u4e8b, \u89e3\u538b\u5c31\u80fd\u4f7f\u4e86<\/p>\n<p>\u76ee\u524d\u6ca1\u53d1\u73b0\u5927\u95ee\u9898. \u6253\u5305 pyz \u4e4b\u524d\u7528\u7684 shiv, \u73b0\u5728\u5728\u81ea\u5df1\u5199. \u603b\u4e4b zip \u6587\u4ef6\u91cc\u5176\u5b9e\u653e\u7684\u5c31\u662f\u4e00\u5806 pip \u4e0b\u4e0b\u6765\u7684\u5305\u6216\u8005\u81ea\u5df1\u6dfb\u52a0\u8fdb\u53bb\u7684\u4f9d\u8d56, \u53ea\u8981\u6ce8\u610f\u4e00\u4e0b\u7f16\u8bd1\u76f8\u5173\u7684\u51b2\u7a81\u5c31\u597d\u4e86, \u6bd4\u5982\u8de8\u5e73\u53f0(Linux \u7f16\u8bd1\u7684\u6ca1\u6cd5\u5728 win \u4e0a)\u6216\u8005\u8de8 python \u7248\u672c(3.7 \u548c 3.8 \u6709\u65f6\u5019\u90fd\u56e0\u4e3a\u7f16\u8bd1\u5668\u4e0d\u4e00\u81f4\u51fa\u95ee\u9898)                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u5bf9\u865a\u62df\u73af\u5883\u719f\u6089\u7684\u5927\u4f6c\u5417 \u8cc7\u6df1\u5927\u4f6c&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/229378"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=229378"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/229378\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=229378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=229378"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=229378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}