{"id":921602,"date":"2024-12-26T14:15:49","date_gmt":"2024-12-26T06:15:49","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/921602.html"},"modified":"2024-12-26T14:15:51","modified_gmt":"2024-12-26T06:15:51","slug":"%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%85python%e6%a8%a1%e5%9d%97","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/921602.html","title":{"rendered":"\u5982\u4f55\u5b89\u88c5python\u6a21\u5757"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24210448\/536aa86f-1869-40fe-8210-1dd0dee5782e.webp\" alt=\"\u5982\u4f55\u5b89\u88c5python\u6a21\u5757\" \/><\/p>\n<p><p> <strong>\u5982\u4f55\u5b89\u88c5Python\u6a21\u5757\u4e3b\u8981\u4f9d\u8d56\u4e8e\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\uff1a\u4f7f\u7528\u5305\u7ba1\u7406\u5668pip\u3001\u4f7f\u7528Anaconda\u8fdb\u884c\u5b89\u88c5\u3001\u4ece\u6e90\u4ee3\u7801\u5b89\u88c5\u3002<\/strong>\u5176\u4e2d\uff0c\u6700\u5e38\u89c1\u548c\u4fbf\u6377\u7684\u65b9\u6cd5\u662f\u4f7f\u7528pip\u5305\u7ba1\u7406\u5668\u3002pip\u662fPython\u7684\u6807\u51c6\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u80fd\u591f\u4ecePython Package Index (PyPI) \u4e0b\u8f7d\u5e76\u5b89\u88c5\u8f6f\u4ef6\u5305\u3002\u63a5\u4e0b\u6765\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528pip\u5b89\u88c5Python\u6a21\u5757\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528PIP\u5b89\u88c5<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5\u548c\u66f4\u65b0PIP<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u5927\u591a\u6570Python\u53d1\u884c\u7248\u4e2d\uff0cpip\u4f1a\u81ea\u52a8\u5b89\u88c5\u3002\u4f46\u662f\uff0c\u4e3a\u4e86\u786e\u4fdd\u60a8\u4f7f\u7528\u7684\u662f\u6700\u65b0\u7248\u672c\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u66f4\u65b0\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python -m pip install --upgrade pip<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u786e\u4fddpip\u672c\u8eab\u662f\u6700\u65b0\u7684\u7248\u672c\uff0c\u4ece\u800c\u907f\u514d\u5728\u5b89\u88c5\u5176\u4ed6\u6a21\u5757\u65f6\u51fa\u73b0\u517c\u5bb9\u6027\u95ee\u9898\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528PIP\u5b89\u88c5\u6a21\u5757<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528pip\u5b89\u88c5\u6a21\u5757\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u77e5\u9053\u6a21\u5757\u7684\u540d\u79f0\u5373\u53ef\u3002\u5047\u8bbe\u60a8\u8981\u5b89\u88c5requests\u6a21\u5757\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\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\u5c06\u4ecePyPI\u4e0a\u4e0b\u8f7drequests\u6a21\u5757\uff0c\u5e76\u5c06\u5176\u5b89\u88c5\u5230\u60a8\u7684Python\u73af\u5883\u4e2d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u7279\u5b9a\u7248\u672c\u7684\u6a21\u5757<\/strong><\/p>\n<\/p>\n<p><p>\u6709\u65f6\u5019\u60a8\u53ef\u80fd\u9700\u8981\u5b89\u88c5\u6a21\u5757\u7684\u7279\u5b9a\u7248\u672c\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5757\u540d\u79f0\u540e\u6dfb\u52a0\u7248\u672c\u53f7\u6765\u5b9e\u73b0\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install requests==2.25.1<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u9879\u76ee\u5728\u7279\u5b9a\u7248\u672c\u7684\u6a21\u5757\u4e0a\u8fd0\u884c\u4e0d\u4f1a\u51fa\u9519\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u591a\u4e2a\u6a21\u5757<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u60a8\u9700\u8981\u540c\u65f6\u5b89\u88c5\u591a\u4e2a\u6a21\u5757\uff0c\u53ef\u4ee5\u4f7f\u7528requirements\u6587\u4ef6\u3002\u9996\u5148\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3arequirements.txt\u7684\u6587\u4ef6\uff0c\u5217\u51fa\u6240\u6709\u9700\u8981\u7684\u6a21\u5757\uff1a<\/p>\n<\/p>\n<p><pre><code>requests==2.25.1<\/p>\n<p>numpy<\/p>\n<p>pandas&gt;=1.1.0<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5\u6587\u4ef6\u4e2d\u5217\u51fa\u7684\u6240\u6709\u6a21\u5757\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install -r requirements.txt<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u7279\u522b\u9002\u5408\u9879\u76ee\u534f\u4f5c\uff0c\u786e\u4fdd\u6bcf\u4e2a\u5f00\u53d1\u8005\u90fd\u4f7f\u7528\u76f8\u540c\u7684\u6a21\u5757\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5378\u8f7d\u6a21\u5757<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u60a8\u9700\u8981\u5378\u8f7d\u67d0\u4e2a\u6a21\u5757\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip uninstall requests<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u4ece\u60a8\u7684\u73af\u5883\u4e2d\u5220\u9664requests\u6a21\u5757\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u4f7f\u7528ANACONDA\u8fdb\u884c\u5b89\u88c5<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4e86\u89e3Anaconda<\/strong><\/p>\n<\/p>\n<p><p>Anaconda\u662f\u4e00\u4e2a\u5f00\u6e90\u7684Python\u53d1\u884c\u7248\uff0c\u4e13\u4e3a\u79d1\u5b66\u8ba1\u7b97\u3001\u6570\u636e\u79d1\u5b66\u548c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u800c\u8bbe\u8ba1\u3002\u5b83\u81ea\u5e26\u4e00\u4e2a\u5305\u7ba1\u7406\u5668conda\uff0c\u53ef\u4ee5\u7528\u6765\u5b89\u88c5\u548c\u7ba1\u7406Python\u6a21\u5757\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Anaconda<\/strong><\/p>\n<\/p>\n<p><p>\u9996\u5148\u9700\u8981\u5728Anaconda\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5Anaconda\u3002\u5b89\u88c5\u8fc7\u7a0b\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u6309\u7167\u63d0\u793a\u64cd\u4f5c\u5373\u53ef\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528Conda\u5b89\u88c5\u6a21\u5757<\/strong><\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528conda\u6765\u5b89\u88c5\u6a21\u5757\u3002\u5047\u8bbe\u60a8\u8981\u5b89\u88c5numpy\u6a21\u5757\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda install numpy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u4eceAnaconda\u7684\u5b98\u65b9\u4ed3\u5e93\u4e0b\u8f7d\u5e76\u5b89\u88c5numpy\u6a21\u5757\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efa\u548c\u7ba1\u7406\u865a\u62df\u73af\u5883<\/strong><\/p>\n<\/p>\n<p><p>Anaconda\u5141\u8bb8\u60a8\u521b\u5efa\u865a\u62df\u73af\u5883\uff0c\u4ee5\u4fbf\u5728\u4e0d\u540c\u7684\u9879\u76ee\u4e2d\u4f7f\u7528\u4e0d\u540c\u7684\u6a21\u5757\u7248\u672c\u3002\u521b\u5efa\u65b0\u7684\u865a\u62df\u73af\u5883\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda create --name myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6fc0\u6d3b\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda activate myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u865a\u62df\u73af\u5883\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528conda\u6216pip\u5b89\u88c5\u6a21\u5757\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u66f4\u65b0\u548c\u5378\u8f7d\u6a21\u5757<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528conda\u66f4\u65b0\u6a21\u5757\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda update numpy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5378\u8f7d\u6a21\u5757\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda remove numpy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u4ece\u6e90\u4ee3\u7801\u5b89\u88c5<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4e0b\u8f7d\u6e90\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<p><p>\u6709\u4e9b\u6a21\u5757\u53ef\u80fd\u6ca1\u6709\u5728PyPI\u4e0a\u53d1\u5e03\uff0c\u60a8\u9700\u8981\u4ece\u6e90\u7801\u8fdb\u884c\u5b89\u88c5\u3002\u901a\u5e38\uff0c\u6e90\u7801\u4f1a\u6258\u7ba1\u5728GitHub\u6216\u5176\u4ed6\u4ee3\u7801\u6258\u7ba1\u5e73\u53f0\u4e0a\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528Git\u514b\u9686\u4ed3\u5e93<\/strong><\/p>\n<\/p>\n<p><p>\u5047\u8bbe\u67d0\u4e2a\u6a21\u5757\u6258\u7ba1\u5728GitHub\u4e0a\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528git\u547d\u4ee4\u514b\u9686\u4ed3\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">git clone https:\/\/github.com\/user\/repo.git<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u4e0b\u8f7d\u9879\u76ee\u7684\u6240\u6709\u6e90\u7801\u6587\u4ef6\u5230\u672c\u5730\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u6a21\u5757<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u6e90\u7801\u76ee\u5f55\u4e0b\uff0c\u901a\u5e38\u4f1a\u6709\u4e00\u4e2asetup.py\u6587\u4ef6\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u6a21\u5757\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">cd repo<\/p>\n<p>python setup.py install<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u6839\u636esetup.py\u4e2d\u7684\u914d\u7f6e\u5b89\u88c5\u6a21\u5757\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5f00\u53d1\u6a21\u5f0f\u5b89\u88c5<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u60a8\u9700\u8981\u5bf9\u6a21\u5757\u8fdb\u884c\u5f00\u53d1\uff0c\u53ef\u4ee5\u4f7f\u7528\u5f00\u53d1\u6a21\u5f0f\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python setup.py develop<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5141\u8bb8\u60a8\u5728\u4e0d\u91cd\u65b0\u5b89\u88c5\u7684\u60c5\u51b5\u4e0b\uff0c\u76f4\u63a5\u5728\u6e90\u7801\u76ee\u5f55\u4e2d\u8fdb\u884c\u6a21\u5757\u7684\u5f00\u53d1\u548c\u6d4b\u8bd5\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u5b89\u88c5\u65f6\u5e38\u89c1\u95ee\u9898\u548c\u89e3\u51b3\u65b9\u6848<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u7f51\u7edc\u95ee\u9898<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u4f7f\u7528pip\u6216conda\u5b89\u88c5\u6a21\u5757\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u7f51\u7edc\u95ee\u9898\u3002\u53ef\u4ee5\u5c1d\u8bd5\u66f4\u6362\u56fd\u5185\u955c\u50cf\u6e90\u6765\u52a0\u901f\u4e0b\u8f7d\u3002\u4f8b\u5982\uff0c\u4f7f\u7528pip\u65f6\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u540e\u6dfb\u52a0-i\u53c2\u6570\u6307\u5b9a\u955c\u50cf\u6e90\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install requests -i https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6743\u9650\u95ee\u9898<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u7cfb\u7edf\u4e2d\uff0c\u5b89\u88c5\u6a21\u5757\u53ef\u80fd\u9700\u8981\u7ba1\u7406\u5458\u6743\u9650\u3002\u53ef\u4ee5\u5c1d\u8bd5\u4f7f\u7528sudo\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo pip install requests<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216\u8005\u4f7f\u7528&#8211;user\u53c2\u6570\u5b89\u88c5\u5230\u7528\u6237\u76ee\u5f55\u4e2d\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install requests --user<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6a21\u5757\u517c\u5bb9\u6027\u95ee\u9898<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u5b89\u88c5\u67d0\u4e9b\u6a21\u5757\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u7248\u672c\u517c\u5bb9\u6027\u95ee\u9898\u3002\u53ef\u4ee5\u53c2\u8003\u6a21\u5757\u7684\u5b98\u65b9\u6587\u6863\uff0c\u786e\u4fdd\u4f7f\u7528\u7684\u662f\u652f\u6301\u5f53\u524dPython\u7248\u672c\u7684\u6a21\u5757\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u73af\u5883\u4e2d\u7075\u6d3b\u5730\u5b89\u88c5\u548c\u7ba1\u7406Python\u6a21\u5757\uff0c\u786e\u4fdd\u9879\u76ee\u7684\u987a\u5229\u8fdb\u884c\u3002\u65e0\u8bba\u662f\u4f7f\u7528pip\u8fd8\u662fAnaconda\uff0c\u6216\u662f\u4ece\u6e90\u4ee3\u7801\u5b89\u88c5\uff0c\u638c\u63e1\u8fd9\u4e9b\u6280\u80fd\u90fd\u5c06\u6781\u5927\u5730\u63d0\u5347\u60a8\u7684Python\u5f00\u53d1\u6548\u7387\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u786e\u5b9a\u9700\u8981\u5b89\u88c5\u54ea\u4e2aPython\u6a21\u5757\uff1f<\/strong><br \/>\u5728\u51b3\u5b9a\u5b89\u88c5Python\u6a21\u5757\u4e4b\u524d\uff0c\u53ef\u4ee5\u6839\u636e\u9879\u76ee\u9700\u6c42\u6216\u529f\u80fd\u9700\u6c42\u6765\u9009\u62e9\u6a21\u5757\u3002\u5e38\u89c1\u7684\u65b9\u5f0f\u662f\u67e5\u770b\u5b98\u65b9\u6587\u6863\u3001\u5f00\u53d1\u8005\u8bba\u575b\u3001\u5f00\u6e90\u9879\u76ee\u7684\u4f9d\u8d56\u5217\u8868\u6216\u5728PyPI\uff08Python Package Index\uff09\u4e0a\u641c\u7d22\u76f8\u5173\u6a21\u5757\u3002\u4e5f\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9879\u76ee\u7279\u70b9\uff0c\u4f7f\u7528<code>pip search &lt;\u5173\u952e\u8bcd&gt;<\/code>\u547d\u4ee4\u6765\u67e5\u627e\u53ef\u80fd\u9002\u7528\u7684\u6a21\u5757\u3002<\/p>\n<p><strong>\u5b89\u88c5Python\u6a21\u5757\u540e\u5982\u4f55\u9a8c\u8bc1\u5176\u662f\u5426\u6210\u529f\uff1f<\/strong><br \/>\u5728\u5b89\u88c5\u5b8c\u6a21\u5757\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728Python\u4ea4\u4e92\u5f0f\u73af\u5883\u4e2d\u5c1d\u8bd5\u5bfc\u5165\u8be5\u6a21\u5757\u6765\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>import module_name<\/code>\u547d\u4ee4\uff0c\u5982\u679c\u6ca1\u6709\u51fa\u73b0\u9519\u8bef\u63d0\u793a\uff0c\u5219\u8bf4\u660e\u6a21\u5757\u5df2\u6210\u529f\u5b89\u88c5\u3002\u8fd8\u53ef\u4ee5\u4f7f\u7528<code>pip list<\/code>\u547d\u4ee4\u67e5\u770b\u5f53\u524d\u73af\u5883\u4e2d\u5df2\u5b89\u88c5\u7684\u6240\u6709\u6a21\u5757\u53ca\u5176\u7248\u672c\uff0c\u4ee5\u786e\u8ba4\u65b0\u5b89\u88c5\u7684\u6a21\u5757\u662f\u5426\u5728\u5217\u8868\u4e2d\u3002<\/p>\n<p><strong>\u662f\u5426\u53ef\u4ee5\u540c\u65f6\u5b89\u88c5\u591a\u4e2aPython\u6a21\u5757\uff1f<\/strong><br \/>\u786e\u5b9e\u53ef\u4ee5\u901a\u8fc7\u5728<code>pip install<\/code>\u547d\u4ee4\u540e\u5217\u51fa\u591a\u4e2a\u6a21\u5757\u540d\u6765\u540c\u65f6\u5b89\u88c5\u591a\u4e2aPython\u6a21\u5757\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>pip install module1 module2 module3<\/code>\u53ef\u4ee5\u4e00\u6b21\u6027\u5b89\u88c5\u8fd9\u4e09\u4e2a\u6a21\u5757\u3002\u6b64\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a<code>requirements.txt<\/code>\u6587\u4ef6\uff0c\u5c06\u6240\u6709\u9700\u8981\u7684\u6a21\u5757\u53ca\u5176\u7248\u672c\u5217\u51fa\uff0c\u5e76\u4f7f\u7528<code>pip install -r requirements.txt<\/code>\u547d\u4ee4\u6765\u6279\u91cf\u5b89\u88c5\u3002\u8fd9\u79cd\u65b9\u5f0f\u5c24\u5176\u9002\u5408\u56e2\u961f\u5408\u4f5c\u6216\u9879\u76ee\u8fc1\u79fb\u65f6\u4f7f\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5982\u4f55\u5b89\u88c5Python\u6a21\u5757\u4e3b\u8981\u4f9d\u8d56\u4e8e\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\uff1a\u4f7f\u7528\u5305\u7ba1\u7406\u5668pip\u3001\u4f7f\u7528Anaconda\u8fdb\u884c\u5b89\u88c5\u3001\u4ece\u6e90\u4ee3\u7801\u5b89\u88c5 [&hellip;]","protected":false},"author":3,"featured_media":921608,"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\/921602"}],"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=921602"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/921602\/revisions"}],"predecessor-version":[{"id":921611,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/921602\/revisions\/921611"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/921608"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=921602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=921602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=921602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}