{"id":1007965,"date":"2024-12-27T10:58:30","date_gmt":"2024-12-27T02:58:30","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1007965.html"},"modified":"2024-12-27T10:58:32","modified_gmt":"2024-12-27T02:58:32","slug":"python%e5%a6%82%e4%bd%95%e5%88%9b%e9%80%a0%e6%96%b0%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1007965.html","title":{"rendered":"Python\u5982\u4f55\u521b\u9020\u65b0\u73af\u5883"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25083450\/8a2f9f6f-146e-453e-b424-8389ef40d43c.webp\" alt=\"Python\u5982\u4f55\u521b\u9020\u65b0\u73af\u5883\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u521b\u9020\u65b0\u73af\u5883\uff0c\u53ef\u4ee5\u4f7f\u7528\u865a\u62df\u73af\u5883\u3001Docker\u3001Anaconda\u7b49\u5de5\u5177<\/strong>\u3002<strong>\u865a\u62df\u73af\u5883<\/strong>\u662f\u6700\u5e38\u7528\u7684\u65b9\u6cd5\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u8005\u5728\u9879\u76ee\u76ee\u5f55\u4e2d\u521b\u5efa\u72ec\u7acb\u7684Python\u73af\u5883\uff0c\u4ece\u800c\u907f\u514d\u4e0d\u540c\u9879\u76ee\u4e4b\u95f4\u7684\u4f9d\u8d56\u51b2\u7a81\u3002<strong>Docker<\/strong>\u5219\u63d0\u4f9b\u4e86\u66f4\u4e3a\u9694\u79bb\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u901a\u8fc7\u5bb9\u5668\u6280\u672f\u6765\u8fd0\u884cPython\u5e94\u7528\u3002<strong>Anaconda<\/strong>\u9002\u5408\u6570\u636e\u79d1\u5b66\u9886\u57df\u7684\u5f00\u53d1\u8005\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u73af\u5883\u7ba1\u7406\u5668\u548c\u5927\u91cf\u7684\u79d1\u5b66\u8ba1\u7b97\u5e93\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u63a2\u8ba8\u865a\u62df\u73af\u5883\u7684\u521b\u5efa\u8fc7\u7a0b\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528VIRTUALENV\u521b\u5efa\u865a\u62df\u73af\u5883<\/h3>\n<\/p>\n<p><p>\u865a\u62df\u73af\u5883\u662fPython\u5185\u7f6e\u7684\u5de5\u5177\uff0c\u7528\u4e8e\u521b\u5efa\u9694\u79bb\u7684Python\u73af\u5883\u3002\u901a\u8fc7\u4f7f\u7528\u865a\u62df\u73af\u5883\uff0c\u60a8\u53ef\u4ee5\u5728\u540c\u4e00\u53f0\u673a\u5668\u4e0a\u8fd0\u884c\u591a\u4e2a\u9879\u76ee\uff0c\u800c\u4e0d\u4f1a\u51fa\u73b0\u4f9d\u8d56\u51b2\u7a81\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5VIRTUALENV<\/h4>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5\u4e86<code>virtualenv<\/code>\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5\u5b83\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install virtualenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u521b\u5efa\u865a\u62df\u73af\u5883<\/h4>\n<\/p>\n<p><p>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u865a\u62df\u73af\u5883\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b8c\u6210\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">virtualenv myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u91cc\u7684<code>myenv<\/code>\u662f\u865a\u62df\u73af\u5883\u7684\u540d\u79f0\uff0c\u60a8\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8fdb\u884c\u66f4\u6539\u3002\u8fd9\u4e2a\u547d\u4ee4\u5c06\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>myenv<\/code>\u7684\u6587\u4ef6\u5939\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u72ec\u7acb\u7684Python\u89e3\u91ca\u5668\u548c\u5305\u7ba1\u7406\u5de5\u5177\u3002<\/p>\n<\/p>\n<p><h4>3. \u6fc0\u6d3b\u865a\u62df\u73af\u5883<\/h4>\n<\/p>\n<p><p>\u521b\u5efa\u73af\u5883\u540e\uff0c\u60a8\u9700\u8981\u6fc0\u6d3b\u5b83\u624d\u80fd\u4f7f\u7528\u3002\u6fc0\u6d3b\u73af\u5883\u7684\u65b9\u6cd5\u56e0\u64cd\u4f5c\u7cfb\u7edf\u800c\u5f02\uff1a<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u5728Windows\u4e0a\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">myenv\\Scripts\\activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5728Unix\u6216MacOS\u4e0a\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">source myenv\/bin\/activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u6fc0\u6d3b\u540e\uff0c\u60a8\u5c06\u5728\u547d\u4ee4\u884c\u63d0\u793a\u7b26\u524d\u770b\u5230\u73af\u5883\u540d\u79f0\uff0c\u8fd9\u8868\u793a\u60a8\u73b0\u5728\u4f4d\u4e8e\u8be5\u73af\u5883\u4e2d\u3002<\/p>\n<\/p>\n<p><h4>4. \u5728\u865a\u62df\u73af\u5883\u4e2d\u5b89\u88c5\u5305<\/h4>\n<\/p>\n<p><p>\u6fc0\u6d3b\u865a\u62df\u73af\u5883\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>pip<\/code>\u6765\u5b89\u88c5\u9879\u76ee\u6240\u9700\u7684\u4f9d\u8d56\u5305\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install requests<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e9b\u5305\u5c06\u88ab\u5b89\u88c5\u5728\u865a\u62df\u73af\u5883\u4e2d\uff0c\u800c\u4e0d\u662f\u5168\u5c40Python\u73af\u5883\u4e2d\u3002<\/p>\n<\/p>\n<p><h4>5. \u9000\u51fa\u865a\u62df\u73af\u5883<\/h4>\n<\/p>\n<p><p>\u5b8c\u6210\u5f00\u53d1\u5de5\u4f5c\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u9000\u51fa\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">deactivate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528PYTHON VENV\u6a21\u5757<\/h3>\n<\/p>\n<p><p>Python 3.3\u53ca\u4ee5\u4e0a\u7248\u672c\u63d0\u4f9b\u4e86<code>venv<\/code>\u6a21\u5757\u7528\u4e8e\u521b\u5efa\u865a\u62df\u73af\u5883\uff0c\u8fd9\u662fPython\u6807\u51c6\u5e93\u7684\u4e00\u90e8\u5206\uff0c\u65e0\u9700\u989d\u5916\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p><h4>1. \u521b\u5efa\u865a\u62df\u73af\u5883<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528<code>venv<\/code>\u6a21\u5757\u521b\u5efa\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python -m venv myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e2a\u547d\u4ee4\u5c06\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>myenv<\/code>\u7684\u6587\u4ef6\u5939\uff0c\u5176\u4e2d\u5305\u542b\u72ec\u7acb\u7684Python\u73af\u5883\u3002<\/p>\n<\/p>\n<p><h4>2. \u6fc0\u6d3b\u548c\u4f7f\u7528\u865a\u62df\u73af\u5883<\/h4>\n<\/p>\n<p><p>\u6fc0\u6d3b\u548c\u4f7f\u7528<code>venv<\/code>\u521b\u5efa\u7684\u865a\u62df\u73af\u5883\u4e0e<code>virtualenv<\/code>\u7c7b\u4f3c\uff1a<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u5728Windows\u4e0a\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">myenv\\Scripts\\activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5728Unix\u6216MacOS\u4e0a\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">source myenv\/bin\/activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u6fc0\u6d3b\u540e\uff0c\u60a8\u53ef\u4ee5\u5728\u865a\u62df\u73af\u5883\u4e2d\u5b89\u88c5\u548c\u7ba1\u7406Python\u5305\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528DOCKER\u521b\u5efa\u9694\u79bb\u73af\u5883<\/h3>\n<\/p>\n<p><p>Docker\u662f\u4e00\u4e2a\u5bb9\u5668\u5316\u5e73\u53f0\uff0c\u5141\u8bb8\u60a8\u5728\u9694\u79bb\u7684\u73af\u5883\u4e2d\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u3002\u5b83\u4e0e\u865a\u62df\u73af\u5883\u4e0d\u540c\uff0c\u56e0\u4e3a\u5b83\u63d0\u4f9b\u4e86\u64cd\u4f5c\u7cfb\u7edf\u7ea7\u522b\u7684\u9694\u79bb\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5DOCKER<\/h4>\n<\/p>\n<p><p>\u5728\u4f7f\u7528Docker\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u5728\u7cfb\u7edf\u4e0a\u5b89\u88c5Docker\u3002\u53ef\u4ee5\u4eceDocker\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5\u9002\u7528\u4e8e\u60a8\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\u3002<\/p>\n<\/p>\n<p><h4>2. \u521b\u5efaDOCKERFILE<\/h4>\n<\/p>\n<p><p>\u4e3a\u4e86\u8fd0\u884cPython\u5e94\u7528\u7a0b\u5e8f\uff0c\u60a8\u9700\u8981\u521b\u5efa\u4e00\u4e2a<code>Dockerfile<\/code>\uff0c\u5b9a\u4e49\u5e94\u7528\u7a0b\u5e8f\u7684\u73af\u5883\u3002<\/p>\n<\/p>\n<p><p>\u793a\u4f8b<code>Dockerfile<\/code>\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-Dockerfile\">FROM python:3.9<\/p>\n<p>WORKDIR \/app<\/p>\n<p>COPY . \/app<\/p>\n<p>RUN pip install -r requirements.txt<\/p>\n<p>CMD [&quot;python&quot;, &quot;app.py&quot;]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u6784\u5efa\u548c\u8fd0\u884cDOCKER\u955c\u50cf<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6784\u5efaDocker\u955c\u50cf\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">docker build -t my-python-app .<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u8fd0\u884cDocker\u5bb9\u5668\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">docker run -d my-python-app<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f7f\u7528Docker\uff0c\u60a8\u53ef\u4ee5\u786e\u4fdd\u5e94\u7528\u7a0b\u5e8f\u5728\u4efb\u4f55\u73af\u5883\u4e0b\u90fd\u80fd\u4ee5\u76f8\u540c\u7684\u65b9\u5f0f\u8fd0\u884c\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528ANACONDA\u521b\u5efa\u865a\u62df\u73af\u5883<\/h3>\n<\/p>\n<p><p>Anaconda\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u6570\u636e\u79d1\u5b66\u5e73\u53f0\uff0c\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u5305\u7ba1\u7406\u548c\u73af\u5883\u7ba1\u7406\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5ANACONDA<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u4eceAnaconda\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5Anaconda\u3002<\/p>\n<\/p>\n<p><h4>2. \u521b\u5efaCONDA\u73af\u5883<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528<code>conda<\/code>\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda create --name myenv python=3.9<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u5728Anaconda\u4e2d\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>myenv<\/code>\u7684\u73af\u5883\uff0c\u5e76\u5b89\u88c5Python 3.9\u3002<\/p>\n<\/p>\n<p><h4>3. \u6fc0\u6d3bCONDA\u73af\u5883<\/h4>\n<\/p>\n<p><p>\u6fc0\u6d3b\u73af\u5883\u7684\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda activate myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6fc0\u6d3b\u540e\uff0c\u60a8\u53ef\u4ee5\u5728\u73af\u5883\u4e2d\u5b89\u88c5\u5305\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda install numpy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4. \u7ba1\u7406CONDA\u73af\u5883<\/h4>\n<\/p>\n<p><p>Anaconda\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u5de5\u5177\u6765\u7ba1\u7406\u73af\u5883\uff0c\u60a8\u53ef\u4ee5\u5217\u51fa\u6240\u6709\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda env list<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8981\u5220\u9664\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda remove --name myenv --all<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4f7f\u7528Anaconda\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u5730\u521b\u5efa\u3001\u7ba1\u7406\u548c\u5171\u4eab\u6570\u636e\u79d1\u5b66\u9879\u76ee\u7684\u73af\u5883\u3002<\/p>\n<\/p>\n<p><h3>\u7ed3\u8bba<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\u521b\u5efa\u65b0\u73af\u5883\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u53d6\u51b3\u4e8e\u9879\u76ee\u9700\u6c42\u548c\u4e2a\u4eba\u504f\u597d\u3002<strong>\u865a\u62df\u73af\u5883<\/strong>\u9002\u5408\u5927\u591a\u6570Python\u9879\u76ee\uff0c\u63d0\u4f9b\u7b80\u5355\u800c\u6709\u6548\u7684\u4f9d\u8d56\u7ba1\u7406\u3002<strong>Docker<\/strong>\u9002\u5408\u9700\u8981\u9ad8\u5ea6\u9694\u79bb\u548c\u53ef\u79fb\u690d\u6027\u7684\u9879\u76ee\uff0c\u5c24\u5176\u662f\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u3002<strong>Anaconda<\/strong>\u5219\u662f\u6570\u636e\u79d1\u5b66\u5bb6\u548c\u5206\u6790\u5e08\u7684\u7406\u60f3\u9009\u62e9\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u79d1\u5b66\u8ba1\u7b97\u5de5\u5177\u548c\u7b80\u5355\u7684\u73af\u5883\u7ba1\u7406\u3002\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\uff0c\u5173\u952e\u662f\u786e\u4fdd\u9879\u76ee\u73af\u5883\u4e0e\u5b9e\u9645\u8fd0\u884c\u73af\u5883\u4e00\u81f4\uff0c\u4ee5\u51cf\u5c11\u90e8\u7f72\u4e2d\u7684\u95ee\u9898\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u521b\u5efa\u865a\u62df\u73af\u5883\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u521b\u5efa\u865a\u62df\u73af\u5883\u7684\u5e38\u7528\u5de5\u5177\u6709<code>venv<\/code>\u548c<code>virtualenv<\/code>\u3002\u4f7f\u7528<code>venv<\/code>\u65f6\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python -m venv myenv<\/code>\uff0c\u5176\u4e2d<code>myenv<\/code>\u662f\u4f60\u60f3\u521b\u5efa\u7684\u865a\u62df\u73af\u5883\u7684\u540d\u79f0\u3002\u6267\u884c\u540e\uff0c\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u751f\u6210\u4e00\u4e2a\u540d\u4e3a<code>myenv<\/code>\u7684\u6587\u4ef6\u5939\uff0c\u91cc\u9762\u5305\u542b\u4e86\u72ec\u7acb\u7684Python\u89e3\u91ca\u5668\u548c\u5e93\u3002\u8981\u6fc0\u6d3b\u8be5\u73af\u5883\uff0c\u5728Windows\u4e0a\u6267\u884c<code>myenv\\Scripts\\activate<\/code>\uff0c\u5728macOS\u6216Linux\u4e0a\u6267\u884c<code>source myenv\/bin\/activate<\/code>\u3002<\/p>\n<p><strong>\u865a\u62df\u73af\u5883\u4e0e\u7cfb\u7edf\u73af\u5883\u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/strong><br \/>\u865a\u62df\u73af\u5883\u63d0\u4f9b\u4e86\u4e00\u4e2a\u72ec\u7acb\u7684\u5de5\u4f5c\u7a7a\u95f4\uff0c\u5141\u8bb8\u7528\u6237\u5728\u540c\u4e00\u7cfb\u7edf\u4e0a\u540c\u65f6\u8fd0\u884c\u591a\u4e2a\u9879\u76ee\uff0c\u800c\u4e0d\u4f1a\u51fa\u73b0\u4f9d\u8d56\u51b2\u7a81\u3002\u6bcf\u4e2a\u865a\u62df\u73af\u5883\u53ef\u4ee5\u62e5\u6709\u5176\u7279\u5b9a\u7684\u5305\u548c\u7248\u672c\uff0c\u8fd9\u6837\u5373\u4f7f\u5728\u5168\u5c40\u73af\u5883\u4e2d\u66f4\u65b0\u6216\u66f4\u6539\u5e93\uff0c\u865a\u62df\u73af\u5883\u4e2d\u7684\u9879\u76ee\u4f9d\u65e7\u80fd\u591f\u6b63\u5e38\u8fd0\u884c\uff0c\u907f\u514d\u4e86\u7248\u672c\u4e0d\u517c\u5bb9\u7684\u95ee\u9898\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u865a\u62df\u73af\u5883\u4e2d\u5b89\u88c5\u7279\u5b9a\u7248\u672c\u7684\u5e93\uff1f<\/strong><br \/>\u5728\u6fc0\u6d3b\u865a\u62df\u73af\u5883\u540e\uff0c\u4f7f\u7528<code>pip install package_name==version_number<\/code>\u547d\u4ee4\u5b89\u88c5\u7279\u5b9a\u7248\u672c\u7684\u5e93\u3002\u4f8b\u5982\uff0c\u82e5\u9700\u8981\u5b89\u88c5<code>requests<\/code>\u5e93\u76842.25.0\u7248\u672c\uff0c\u53ef\u4ee5\u8f93\u5165<code>pip install requests==2.25.0<\/code>\u3002\u8fd9\u5c06\u786e\u4fdd\u5728\u8be5\u865a\u62df\u73af\u5883\u4e2d\u4f7f\u7528\u7684\u662f\u4f60\u6307\u5b9a\u7684\u5e93\u7248\u672c\uff0c\u7ef4\u62a4\u9879\u76ee\u7684\u7a33\u5b9a\u6027\u548c\u517c\u5bb9\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u521b\u9020\u65b0\u73af\u5883\uff0c\u53ef\u4ee5\u4f7f\u7528\u865a\u62df\u73af\u5883\u3001Docker\u3001Anaconda\u7b49\u5de5\u5177\u3002\u865a\u62df\u73af\u5883\u662f\u6700\u5e38\u7528\u7684\u65b9\u6cd5\uff0c\u5b83 [&hellip;]","protected":false},"author":3,"featured_media":1007972,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1007965"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1007965"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1007965\/revisions"}],"predecessor-version":[{"id":1007973,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1007965\/revisions\/1007973"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1007972"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1007965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1007965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1007965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}