{"id":101010,"date":"2020-05-21T05:49:36","date_gmt":"2020-05-20T21:49:36","guid":{"rendered":"http:\/\/4563.org\/?p=101010"},"modified":"2020-05-21T05:49:36","modified_gmt":"2020-05-20T21:49:36","slug":"%e6%9c%89%e4%bb%80%e4%b9%88%e6%96%b9%e6%b3%95%e5%8f%af%e4%bb%a5%e6%b8%85%e7%90%86-venv-%e4%b8%ad%ef%bc%8c%e5%bd%93%e5%89%8d%e9%a1%b9%e7%9b%ae%e4%be%9d%e8%b5%96%e7%9a%84%e5%ba%93%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=101010","title":{"rendered":"\u6709\u4ec0\u4e48\u65b9\u6cd5\u53ef\u4ee5\u6e05\u7406 venv \u4e2d\uff0c\u5f53\u524d\u9879\u76ee\u4f9d\u8d56\u7684\u5e93\u6587\u4ef6\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6709\u4ec0\u4e48\u65b9\u6cd5\u53ef\u4ee5\u6e05\u7406 venv \u4e2d\uff0c\u5f53\u524d\u9879\u76ee\u4f9d\u8d56\u7684\u5e93\u6587\u4ef6\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : miniyao <\/span>  <span><i><\/i> 1<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        \u6709\u4e00\u4e2a\u9879\u76ee\u7684\u865a\u62df\u73af\u5883 venv\uff0c\u5c0f\u7ec4\u6210\u5458\u4e0d\u65ad\u5f80\u91cc\u9762 pip install \u4e86\u5f88\u591a\u4f9d\u8d56\u5e93\uff0c\u7b49\u5230\u8981\u5728\u751f\u4ea7\u673a\u4e0a\u53d1\u5e03\u7684\u65f6\u5019\uff0cpip freeze &gt; requirements.txt \u91cc\u9762\u5c31\u6709\u5f88\u591a\u6709\u7528\u7684\u6ca1\u7528\u7684\u5168\u88c5\u8fdb\u53bb\u4e86\u3002<\/p>\n<p>\u6709\u4ec0\u4e48\u65b9\u6cd5\u53ef\u4ee5\u6e05\u7406\u5417\uff1f\u600e\u4e48\u5206\u79bb requirements.txt \u91cc\u9762\u54ea\u4e9b\u662f\u5fc5\u987b\u4f9d\u8d56\u7684\u5e93\uff0c\u54ea\u4e9b\u662f\u6ca1\u7528\u7684\u5197\u4f59\uff1f      <\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>8<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1669697\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fgwmlhdkkkw <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u80fd\u6709\u591a\u5927\uff1f\u5dee\u90a3\u70b9\u78c1\u76d8\u5417\u2026\u2026                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669698\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fgwmlhdkkkw <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @fgwmlhdkkkw pip list \u53ef\u4ee5\u5217\u51fa\u6240\u6709\u5df2\u5b89\u88c5\u7684\u5305\uff0c\u7136\u540e\u4f60\u8fd0\u884c\u7a0b\u5e8f\uff0c\u5728\u7a0b\u5e8f\u4e2d\u5f97\u5230\u6240\u6709\u9700\u8981\u52a0\u8f7d\u7684\u5305\uff08\u5177\u4f53 api \u6211\u4e0d\u8bb0\u5f97\u4e86\uff0c\u4f46\u662f\u4f60\u751a\u81f3\u53ef\u4ee5 hook import \u6a21\u5757\u6765\u5f97\u5230\uff09\uff0c\u7136\u540e\u5bf9\u6bd4\u4e00\u4e0b\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669699\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wangyzj <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             pipreqs                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669700\" 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>                                                             \u4ee5\u524d\u4e00\u76f4\u7528\u7684 pipenv \u6216 poetry \u7ba1\u7406\u4f9d\u8d56, \u6240\u4ee5\u4f1a\u81ea\u52a8\u6e05\u7406\u4e0d\u7528\u7684<\/p>\n<p>\u4f60\u5982\u679c\u60f3\u627e\u4e2a\u7c7b\u4f3c `go mod tidy` \u7684\u4e1c\u897f&#8230; \u4e3a\u4ec0\u4e48\u4e00\u5f00\u59cb\u4e0d\u5c31\u5199\u597d requirements \u7136\u540e\u4e00\u76f4\u7528\u5b83\u5b89\u88c5\u5462, \u5f88\u5c11\u7528 freeze \u529f\u80fd, requirements \u91cc\u4e5f\u53ea\u5199\u6700\u9876\u5c42\u4f9d\u8d56, \u6240\u4ee5\u9501\u7684\u4f30\u8ba1\u4e0d\u591f\u4e25\u683c, \u624d\u4f7f\u6211\u4e0d\u5f97\u4e0d\u8f6c\u5230 pipenv \u4e0a\u53bb\u7684&#8230;                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669701\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jin7 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             pipdeptree pippurge                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669702\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ericls <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53cd\u4e86 requirements \u5e94\u8be5\u662f source of truth \u800c\u4e0d\u662f\u67d0\u4e2a\u4eba\u7684\u672c\u5730\u73af\u5883<\/p>\n<p>\u7b80\u5355\u529e\u6cd5\u5c31\u662f\u770b\u770b\u54ea\u4e9b\u6709 import \u54af                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669703\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xpresslink <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3b\u8981\u660e\u767d\u4e00\u70b9\u5f88\u91cd\u8981\u7684\u4e1c\u4e1c\uff0crequirements.txt \u53ea\u662f\u5f00\u53d1\u8005\u6240\u9700\u8981\u7684\u6700\u9876\u5c42\u7684\u4f9d\u8d56\u6e05\u5355\u3002<br \/>\u5728\u6267\u884c pip install -r requirements.txt \u7684\u65f6\u5019\u5b89\u88c5\u7684\u4e1c\u897f\u8fdc\u4e0d\u662f\u8fd9\u4e2a\u6e05\u5355\u4e2d\u7684\u5305\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u5305\u672c\u8eab\u8fd8\u8981\u4f9d\u8d56\u5176\u5b83\u7684\u5305\uff0c\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u5982\u679c\u6ca1\u6709\u5c31\u4f1a\u81ea\u52a8\u5b89\u88c5\u5176\u5b83\u5305\u3002<br \/>\u4f46\u662f\u8981\u60f3\u8981\u6e05\u695a\u7684\u77e5\u9053 requirements.txt \u91cc\u9762\u8fd9\u4e9b\u5305\u4f9d\u8d56\u4e86\u54ea\u4e9b\u662f\u6bd4\u8f83\u56f0\u96be\u7684\u3002<br \/>\u6700\u7701\u4e8b\u7684\u529e\u6cd5\u5c31\u662f\u76f4\u63a5\u628a venv \u6574\u6539\u5220\u9664\u4e86\uff0c\u91cd\u5efa\u518d\u6267\u884c pip install -r requirements.txt                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669704\" 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>                                                             \u6700\u8f7b\u91cf\u7684\u65b9\u6cd5\u5c31\u662f 5L @jin7 \u7684\uff0c\u7528 pipdeptree \u67e5\u770b\u4f9d\u8d56\u6811\uff0c\u8fd9\u6837\u53ef\u4ee5\u770b\u5230\u54ea\u4e9b\u5305\u4e0d\u9700\u8981\u518d\u5b89\u5168\u5730\u5378\u8f7d\u6389<\/p>\n<p>\u91cd\u4e00\u70b9\u5c31\u5f15\u5165\u4f9d\u8d56\u7ba1\u7406 Pipenv, Poetry, PDM\uff0c\u628a\u8981\u7684\u4f9d\u8d56\u5b9a\u4e49\u4e0b\u6765\uff0c\u7136\u540e clean \u4e00\u904d\uff0c\u5c31\u628a\u591a\u4f59\u7684\u53bb\u6389\u4e86                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u4ec0\u4e48\u65b9\u6cd5\u53ef\u4ee5\u6e05\u7406 venv \u4e2d\uff0c&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\/101010"}],"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=101010"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/101010\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=101010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=101010"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=101010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}