{"id":7754,"date":"2016-05-27T08:28:05","date_gmt":"2016-05-27T00:28:05","guid":{"rendered":"http:\/\/jpuyy.com\/?p=7754"},"modified":"2020-03-04T15:39:11","modified_gmt":"2020-03-04T07:39:11","slug":"python-virtualenv","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=7754","title":{"rendered":"python virtualenv"},"content":{"rendered":"<p>\u5f00\u53d1\u6d4b\u8bd5\u73af\u5883\u5728 virtualenv \u91cc\u8fdb\u884c\u3002<\/p>\n<p>\u5b89\u88c5 pip<\/p>\n<pre>yum install python-pip\n<\/pre>\n<p>\u6216<\/p>\n<pre>curl -O https:\/\/bootstrap.pypa.io\/get-pip.py\nsudo python get-pip.py\n<\/pre>\n<p>\u5982\u679c\u9047\u5230 ssl \u9519\u8bef<\/p>\n<pre>python get-pip.py --trusted-host pypi.python.org<\/pre>\n<p>\u6307\u5b9a pypi<\/p>\n<pre> pip install -i http:\/\/pypi.douban.com\/simple\/ autobahntestsuite --trusted-host pypi.douban.com<\/pre>\n<p>\u5b89\u88c5 virtualenv<\/p>\n<pre>sudo pip install virtualenv<\/pre>\n<pre>pip3 install virtualenv -i https:\/\/mirrors.aliyun.com\/pypi\/simple<\/pre>\n<p>\u4f7f\u7528<\/p>\n<pre>virtualenv venv\nsource venv\/bin\/activate\n<\/pre>\n<p>\u73b0\u5728\u5df2\u7ecf\u8fdb\u5165 venv\uff0c\u5b89\u88c5\u9700\u8981\u7684\u6a21\u5757<\/p>\n<pre>pip install flask\npip install redis\n<\/pre>\n<p>\u5c06\u73b0\u6709\u7684\u6a21\u5757 freeze \u4e0b\u6765<\/p>\n<pre>pip freeze &gt; requirements.txt\n<\/pre>\n<p>\u9000\u51fa\u865a\u62df\u73af\u5883<\/p>\n<pre>deactivate<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5f00\u53d1\u6d4b\u8bd5\u73af\u5883\u5728 virtualenv \u91cc\u8fdb\u884c\u3002 \u5b89\u88c5 pip yum install python-pip \u6216 curl -O https:\/\/bootstrap.pypa.io\/get-pip.py sudo python get-pip.py \u5982\u679c\u9047\u5230 ssl \u9519\u8bef python get-pip.py &#8211;trusted-host pypi.python.org \u6307\u5b9a pypi pip install -i http:\/\/pypi.douban.com\/simple\/ autobahntestsuite &#8211;trusted-host pypi.douban.com \u5b89\u88c5 virtualenv sudo pip install virtualenv pip3 install virtualenv -i https:\/\/mirrors.aliyun.com\/pypi\/simple \u4f7f\u7528 virtualenv venv source venv\/bin\/activate \u73b0\u5728\u5df2\u7ecf\u8fdb\u5165 venv\uff0c\u5b89\u88c5\u9700\u8981\u7684\u6a21\u5757 pip install flask pip install redis [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-7754","post","type-post","status-publish","format-standard","hentry","category-life"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/7754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7754"}],"version-history":[{"count":11,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/7754\/revisions"}],"predecessor-version":[{"id":8717,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/7754\/revisions\/8717"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}