{"id":984011,"date":"2024-12-27T07:24:21","date_gmt":"2024-12-26T23:24:21","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/984011.html"},"modified":"2024-12-27T07:24:24","modified_gmt":"2024-12-26T23:24:24","slug":"python%e5%a6%82%e4%bd%95%e6%9b%b4%e6%8d%a2%e5%ae%89%e8%a3%85%e6%ba%90","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/984011.html","title":{"rendered":"python\u5982\u4f55\u66f4\u6362\u5b89\u88c5\u6e90"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24211812\/496c5c0f-ec2e-4e09-a22c-77e37501031b.webp\" alt=\"python\u5982\u4f55\u66f4\u6362\u5b89\u88c5\u6e90\" \/><\/p>\n<p><p> <strong>Python\u66f4\u6362\u5b89\u88c5\u6e90\u7684\u65b9\u6cd5\u4e3b\u8981\u5305\u62ec\uff1a\u4fee\u6539pip\u914d\u7f6e\u6587\u4ef6\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u53c2\u6570\u6307\u5b9a\u6e90\u3001\u4e34\u65f6\u4f7f\u7528\u56fd\u5185\u955c\u50cf\u6e90\u3002\u4e3a\u4e86\u63d0\u9ad8\u4e0b\u8f7d\u901f\u5ea6\u3001\u907f\u514d\u7f51\u7edc\u95ee\u9898\uff0c\u63a8\u8350\u4f7f\u7528\u56fd\u5185\u7684\u955c\u50cf\u6e90\uff0c\u5982\u6e05\u534e\u6e90\u3001\u963f\u91cc\u6e90\u7b49\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5b9e\u73b0\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u5e76\u63a2\u8ba8\u5404\u81ea\u7684\u4f18\u7f3a\u70b9\u548c\u9002\u7528\u573a\u666f\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528Python\u65f6\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0bpip\u4ece\u5b98\u65b9\u7684Python Package Index (PyPI) \u4e0b\u8f7d\u8f6f\u4ef6\u5305\u3002\u7136\u800c\uff0c\u7531\u4e8e\u7f51\u7edc\u539f\u56e0\uff0c\u6709\u65f6\u4ece\u56fd\u5916\u7684PyPI\u4e0b\u8f7d\u901f\u5ea6\u8f83\u6162\uff0c\u751a\u81f3\u53ef\u80fd\u51fa\u73b0\u4e0b\u8f7d\u5931\u8d25\u7684\u60c5\u51b5\u3002\u56e0\u6b64\uff0c\u66f4\u6362\u4e3a\u56fd\u5185\u7684\u5b89\u88c5\u6e90\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u4e0b\u8f7d\u901f\u5ea6\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u63a2\u8ba8\u5982\u4f55\u66f4\u6362Python\u7684\u5b89\u88c5\u6e90\u3002<\/p>\n<\/p>\n<h2><strong>\u4e00\u3001\u4fee\u6539PIP\u914d\u7f6e\u6587\u4ef6<\/strong><\/h2>\n<p><h3>1.1\u3001Windows\u7cfb\u7edf<\/h3>\n<\/p>\n<p><p>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539pip\u7684\u914d\u7f6e\u6587\u4ef6\u6765\u6c38\u4e45\u66f4\u6362\u5b89\u88c5\u6e90\u3002<\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u627e\u5230pip\u7684\u914d\u7f6e\u6587\u4ef6\u76ee\u5f55\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0cpip\u7684\u914d\u7f6e\u6587\u4ef6\u4f4d\u4e8e\u7528\u6237\u4e3b\u76ee\u5f55\u4e0b\u7684<code>pip<\/code>\u6587\u4ef6\u5939\u4e2d\u3002\u5982\u679c\u8be5\u6587\u4ef6\u5939\u4e0d\u5b58\u5728\uff0c\u53ef\u4ee5\u624b\u52a8\u521b\u5efa\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">mkdir %APPDATA%\\pip<\/p>\n<p>notepad %APPDATA%\\pip\\pip.ini<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5728\u6253\u5f00\u7684<code>pip.ini<\/code>\u6587\u4ef6\u4e2d\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-ini\">[global]<\/p>\n<p>index-url = https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u8fd9\u6837\uff0cpip\u5c31\u4f1a\u9ed8\u8ba4\u4f7f\u7528\u6e05\u534e\u5927\u5b66\u7684\u955c\u50cf\u6e90\u8fdb\u884c\u8f6f\u4ef6\u5305\u4e0b\u8f7d\u3002<\/p>\n<\/p>\n<p><h3>1.2\u3001Linux\u548cMacOS\u7cfb\u7edf<\/h3>\n<\/p>\n<p><p>\u5728Linux\u548cMacOS\u7cfb\u7edf\u4e2d\uff0cpip\u7684\u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u4f4d\u4e8e\u7528\u6237\u4e3b\u76ee\u5f55\u4e0b\u7684<code>.pip<\/code>\u76ee\u5f55\u4e2d\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">mkdir ~\/.pip<\/p>\n<p>nano ~\/.pip\/pip.conf<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5728<code>pip.conf<\/code>\u6587\u4ef6\u4e2d\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-ini\">[global]<\/p>\n<p>index-url = https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\u8bbe\u7f6e\u540e\uff0cpip\u5c06\u6c38\u4e45\u4f7f\u7528\u6307\u5b9a\u7684\u955c\u50cf\u6e90\u3002<\/p>\n<\/p>\n<h2><strong>\u4e8c\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u53c2\u6570\u6307\u5b9a\u6e90<\/strong><\/h2>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u53ef\u80fd\u4e0d\u5e0c\u671b\u6c38\u4e45\u66f4\u6362pip\u7684\u6e90\uff0c\u800c\u4ec5\u4ec5\u662f\u4e34\u65f6\u4f7f\u7528\u5176\u4ed6\u6e90\u6765\u5b89\u88c5\u67d0\u4e2a\u7279\u5b9a\u7684\u8f6f\u4ef6\u5305\u3002\u8fd9\u65f6\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u53c2\u6570\u6307\u5b9a\u6e90\u3002<\/p>\n<\/p>\n<p><h3>2.1\u3001\u6307\u5b9a\u5b89\u88c5\u6e90\u7684\u547d\u4ee4<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u8f6f\u4ef6\u5305\uff0c\u5e76\u6307\u5b9a\u4f7f\u7528\u6e05\u534e\u5927\u5b66\u7684\u955c\u50cf\u6e90\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install -i https:\/\/pypi.tuna.tsinghua.edu.cn\/simple package_name<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5176\u4e2d<code>package_name<\/code>\u9700\u8981\u66ff\u6362\u4e3a\u5b9e\u9645\u8981\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\u540d\u79f0\u3002<\/p>\n<\/p>\n<p><h3>2.2\u3001\u4f18\u7f3a\u70b9\u5206\u6790<\/h3>\n<\/p>\n<p><p><strong>\u4f18\u70b9\uff1a<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>\u7075\u6d3b\u6027\u9ad8<\/strong>\uff1a\u53ef\u4ee5\u6839\u636e\u9700\u8981\u968f\u65f6\u6307\u5b9a\u4e0d\u540c\u7684\u6e90\u3002<\/li>\n<li><strong>\u4e0d\u5f71\u54cd\u5176\u4ed6\u5b89\u88c5<\/strong>\uff1a\u4e0d\u6539\u53d8\u9ed8\u8ba4\u914d\u7f6e\uff0c\u4ec5\u5bf9\u5f53\u524d\u547d\u4ee4\u6709\u6548\u3002<\/li>\n<\/ul>\n<p><p><strong>\u7f3a\u70b9\uff1a<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>\u9700\u8981\u624b\u52a8\u8f93\u5165<\/strong>\uff1a\u6bcf\u6b21\u5b89\u88c5\u90fd\u9700\u8981\u624b\u52a8\u6307\u5b9a\u6e90\u3002<\/li>\n<li><strong>\u4e0d\u9002\u5408\u5927\u91cf\u8f6f\u4ef6\u5305\u5b89\u88c5<\/strong>\uff1a\u5982\u679c\u9700\u8981\u540c\u65f6\u5b89\u88c5\u591a\u4e2a\u8f6f\u4ef6\u5305\uff0c\u624b\u52a8\u6307\u5b9a\u6e90\u8f83\u4e3a\u7e41\u7410\u3002<\/li>\n<\/ul>\n<h2><strong>\u4e09\u3001\u4e34\u65f6\u4f7f\u7528\u56fd\u5185\u955c\u50cf\u6e90<\/strong><\/h2>\n<p><p>\u6709\u65f6\uff0c\u7528\u6237\u53ef\u80fd\u9700\u8981\u5728\u67d0\u4e9b\u7279\u5b9a\u60c5\u51b5\u4e0b\uff0c\u5feb\u901f\u5207\u6362\u5230\u56fd\u5185\u955c\u50cf\u6e90\u8fdb\u884c\u5b89\u88c5\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u73af\u5883\u53d8\u91cf\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<p><h3>3.1\u3001\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/h3>\n<\/p>\n<p><p>\u5728Linux\u548cMacOS\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u6765\u4e34\u65f6\u66f4\u6362\u6e90\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">export PIP_INDEX_URL=https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/p>\n<p>pip install package_name<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728Windows\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u63d0\u793a\u7b26\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">set PIP_INDEX_URL=https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/p>\n<p>pip install package_name<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3.2\u3001\u9002\u7528\u573a\u666f<\/h3>\n<\/p>\n<ul>\n<li><strong>\u6d4b\u8bd5<\/strong>\uff1a\u5728\u6d4b\u8bd5\u4e0d\u540c\u6e90\u7684\u901f\u5ea6\u548c\u7a33\u5b9a\u6027\u65f6\uff0c\u4f7f\u7528\u73af\u5883\u53d8\u91cf\u662f\u4e00\u79cd\u5feb\u901f\u4e14\u4e0d\u4f1a\u5f71\u54cd\u7cfb\u7edf\u914d\u7f6e\u7684\u65b9\u6cd5\u3002<\/li>\n<li><strong>\u5355\u6b21\u4efb\u52a1<\/strong>\uff1a\u5728\u6267\u884c\u5355\u6b21\u5b89\u88c5\u4efb\u52a1\u65f6\uff0c\u53ef\u4ee5\u4e34\u65f6\u66f4\u6362\u6e90\uff0c\u800c\u4e0d\u6539\u53d8\u7cfb\u7edf\u7684\u9ed8\u8ba4\u8bbe\u7f6e\u3002<\/li>\n<\/ul>\n<h2><strong>\u56db\u3001\u5e38\u7528\u7684\u56fd\u5185\u955c\u50cf\u6e90<\/strong><\/h2>\n<p><p>\u9664\u4e86\u4e0a\u9762\u63d0\u5230\u7684\u6e05\u534e\u5927\u5b66\u6e90\uff0c\u8fd8\u6709\u5176\u4ed6\u4e00\u4e9b\u5e38\u7528\u7684\u56fd\u5185\u955c\u50cf\u6e90\uff0c\u5b83\u4eec\u63d0\u4f9b\u4e86\u7c7b\u4f3c\u7684\u4e0b\u8f7d\u901f\u5ea6\u548c\u7a33\u5b9a\u6027\u3002<\/p>\n<\/p>\n<p><h3>4.1\u3001\u963f\u91cc\u4e91\u6e90<\/h3>\n<\/p>\n<p><p>\u963f\u91cc\u4e91\u6e90\u662f\u56fd\u5185\u4f7f\u7528\u8f83\u5e7f\u6cdb\u7684\u955c\u50cf\u6e90\u4e4b\u4e00\uff0c\u63d0\u4f9b\u4e86\u7a33\u5b9a\u7684\u4e0b\u8f7d\u901f\u5ea6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-ini\">[global]<\/p>\n<p>index-url = https:\/\/mirrors.aliyun.com\/pypi\/simple\/<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>4.2\u3001\u8c46\u74e3\u6e90<\/h3>\n<\/p>\n<p><p>\u8c46\u74e3\u6e90\u4e5f\u662f\u4e00\u4e2a\u5e38\u7528\u7684\u9009\u62e9\uff0c\u5c24\u5176\u5728\u7279\u5b9a\u5730\u533a\u4e0b\u8f7d\u901f\u5ea6\u8f83\u5feb\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-ini\">[global]<\/p>\n<p>index-url = http:\/\/pypi.douban.com\/simple\/<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>4.3\u3001\u5176\u4ed6\u6e90<\/h3>\n<\/p>\n<ul>\n<li><strong>\u4e2d\u56fd\u79d1\u5b66\u6280\u672f\u5927\u5b66\u6e90<\/strong>\uff1a<code>https:\/\/pypi.mirrors.ustc.edu.cn\/simple\/<\/code><\/li>\n<li><strong>\u534e\u4e2d\u7406\u5de5\u5927\u5b66\u6e90<\/strong>\uff1a<code>http:\/\/pypi.hustunique.com\/<\/code><\/li>\n<\/ul>\n<p><p>\u9009\u62e9\u5408\u9002\u7684\u6e90\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u7684\u7f51\u7edc\u60c5\u51b5\u8fdb\u884c\u8c03\u6574\uff0c\u901a\u5e38\u6765\u8bf4\uff0c\u591a\u5c1d\u8bd5\u51e0\u4e2a\u6e90\uff0c\u9009\u62e9\u4e0b\u8f7d\u901f\u5ea6\u6700\u5feb\u3001\u6700\u7a33\u5b9a\u7684\u5373\u53ef\u3002<\/p>\n<\/p>\n<h2><strong>\u4e94\u3001\u6ce8\u610f\u4e8b\u9879<\/strong><\/h2>\n<p><p>\u5728\u66f4\u6362\u5b89\u88c5\u6e90\u65f6\uff0c\u9700\u6ce8\u610f\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n<\/p>\n<p><h3>5.1\u3001SSL\u8bc1\u4e66\u95ee\u9898<\/h3>\n<\/p>\n<p><p>\u6709\u4e9b\u955c\u50cf\u6e90\u53ef\u80fd\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u51fa\u73b0SSL\u8bc1\u4e66\u9a8c\u8bc1\u5931\u8d25\u7684\u95ee\u9898\u3002\u53ef\u4ee5\u901a\u8fc7\u6dfb\u52a0<code>--trusted-host<\/code>\u53c2\u6570\u6765\u4e34\u65f6\u89e3\u51b3\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install --trusted-host pypi.tuna.tsinghua.edu.cn package_name<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>5.2\u3001\u955c\u50cf\u6e90\u66f4\u65b0<\/h3>\n<\/p>\n<p><p>\u955c\u50cf\u6e90\u7684\u5185\u5bb9\u662f\u5b9a\u671f\u66f4\u65b0\u7684\uff0c\u4f46\u53ef\u80fd\u5b58\u5728\u4e00\u5b9a\u7684\u5ef6\u8fdf\u3002\u5982\u679c\u9700\u8981\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684\u8f6f\u4ef6\u5305\uff0c\u5efa\u8bae\u9009\u62e9\u66f4\u65b0\u9891\u7387\u8f83\u9ad8\u7684\u6e90\u3002<\/p>\n<\/p>\n<p><h3>5.3\u3001\u517c\u5bb9\u6027\u95ee\u9898<\/h3>\n<\/p>\n<p><p>\u67d0\u4e9b\u8f6f\u4ef6\u5305\u53ef\u80fd\u5bf9\u7279\u5b9a\u7684\u955c\u50cf\u6e90\u5b58\u5728\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u7279\u522b\u662f\u5728\u4f7f\u7528\u975e\u5b98\u65b9\u6e90\u65f6\uff0c\u9700\u7279\u522b\u6ce8\u610f\u3002<\/p>\n<\/p>\n<h2><strong>\u516d\u3001\u603b\u7ed3<\/strong><\/h2>\n<p><p>\u66f4\u6362Python\u7684\u5b89\u88c5\u6e90\u662f\u4e00\u79cd\u63d0\u9ad8\u4e0b\u8f7d\u901f\u5ea6\u548c\u6210\u529f\u7387\u7684\u6709\u6548\u65b9\u6cd5\u3002\u901a\u8fc7\u4fee\u6539pip\u914d\u7f6e\u6587\u4ef6\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u53c2\u6570\u6216\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u7528\u6237\u53ef\u4ee5\u6839\u636e\u9700\u8981\u7075\u6d3b\u9009\u62e9\u5408\u9002\u7684\u955c\u50cf\u6e90\u3002\u5e38\u7528\u7684\u56fd\u5185\u955c\u50cf\u6e90\u5305\u62ec\u6e05\u534e\u5927\u5b66\u6e90\u3001\u963f\u91cc\u4e91\u6e90\u548c\u8c46\u74e3\u6e90\u7b49\u3002\u9009\u62e9\u65f6\u9700\u8003\u8651\u6e90\u7684\u7a33\u5b9a\u6027\u3001\u66f4\u65b0\u9891\u7387\u4ee5\u53caSSL\u8bc1\u4e66\u517c\u5bb9\u6027\u7b49\u56e0\u7d20\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u5efa\u8bae\u6839\u636e\u7f51\u7edc\u73af\u5883\u548c\u5177\u4f53\u9700\u6c42\uff0c\u9009\u62e9\u6700\u9002\u5408\u7684\u955c\u50cf\u6e90\uff0c\u4ee5\u786e\u4fdd\u8f6f\u4ef6\u5305\u5b89\u88c5\u7684\u987a\u5229\u8fdb\u884c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u66f4\u6362pip\u7684\u5b89\u88c5\u6e90\uff1f<\/strong><br \/>\u5728\u4f7f\u7528pip\u5b89\u88c5Python\u5e93\u65f6\uff0c\u9ed8\u8ba4\u7684\u6e90\u53ef\u80fd\u4f1a\u6bd4\u8f83\u6162\u6216\u4e0d\u7a33\u5b9a\u3002\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539pip\u7684\u914d\u7f6e\u6587\u4ef6\u6216\u5728\u547d\u4ee4\u884c\u4e2d\u6307\u5b9a\u6e90\u6765\u66f4\u6362\u5b89\u88c5\u6e90\u3002\u5e38\u89c1\u7684\u56fd\u5185\u955c\u50cf\u6e90\u6709\u6e05\u534e\u5927\u5b66\u3001\u963f\u91cc\u4e91\u7b49\u3002\u5177\u4f53\u65b9\u6cd5\u662f\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528<code>pip install -i &lt;\u6e90\u5730\u5740&gt; &lt;\u5305\u540d&gt;<\/code>\uff0c\u4f8b\u5982\uff1a<code>pip install -i https:\/\/pypi.tuna.tsinghua.edu.cn\/simple numpy<\/code>\u3002<\/p>\n<p><strong>\u66f4\u6362Python\u5b89\u88c5\u6e90\u540e\u4f1a\u5f71\u54cd\u73b0\u6709\u7684\u5305\u5417\uff1f<\/strong><br \/>\u66f4\u6362\u5b89\u88c5\u6e90\u4e0d\u4f1a\u5f71\u54cd\u5df2\u7ecf\u5b89\u88c5\u7684Python\u5305\u3002\u65b0\u7684\u6e90\u4ec5\u5728\u4f60\u4f7f\u7528pip\u5b89\u88c5\u65b0\u5305\u6216\u66f4\u65b0\u73b0\u6709\u5305\u65f6\u751f\u6548\u3002\u56e0\u6b64\uff0c\u73b0\u6709\u7684\u5e93\u548c\u4f9d\u8d56\u4ecd\u7136\u4f1a\u4fdd\u6301\u4e0d\u53d8\uff0c\u9664\u975e\u4f60\u5bf9\u5b83\u4eec\u8fdb\u884c\u624b\u52a8\u66f4\u65b0\u6216\u91cd\u88c5\u3002<\/p>\n<p><strong>\u5982\u4f55\u6c38\u4e45\u66f4\u6539pip\u7684\u5b89\u88c5\u6e90\uff1f<\/strong><br \/>\u8981\u6c38\u4e45\u66f4\u6539pip\u7684\u5b89\u88c5\u6e90\uff0c\u53ef\u4ee5\u5728\u7528\u6237\u76ee\u5f55\u4e0b\u521b\u5efa\u6216\u7f16\u8f91\u4e00\u4e2a\u540d\u4e3a<code>pip.ini<\/code>\uff08Windows\uff09\u6216<code>.pip\/pip.conf<\/code>\uff08Linux\/Mac\uff09\u7684\u914d\u7f6e\u6587\u4ef6\u3002\u5728\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a  <\/p>\n<pre><code>[global]  \nindex-url = https:\/\/pypi.tuna.tsinghua.edu.cn\/simple\n<\/code><\/pre>\n<p>\u8fd9\u6837\uff0c\u6240\u6709\u540e\u7eed\u7684pip\u5b89\u88c5\u5c06\u9ed8\u8ba4\u4f7f\u7528\u65b0\u7684\u6e90\uff0c\u65e0\u9700\u6bcf\u6b21\u90fd\u624b\u52a8\u6307\u5b9a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u66f4\u6362\u5b89\u88c5\u6e90\u7684\u65b9\u6cd5\u4e3b\u8981\u5305\u62ec\uff1a\u4fee\u6539pip\u914d\u7f6e\u6587\u4ef6\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u53c2\u6570\u6307\u5b9a\u6e90\u3001\u4e34\u65f6\u4f7f\u7528\u56fd\u5185\u955c\u50cf\u6e90\u3002\u4e3a\u4e86\u63d0\u9ad8\u4e0b [&hellip;]","protected":false},"author":3,"featured_media":984021,"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\/984011"}],"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=984011"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/984011\/revisions"}],"predecessor-version":[{"id":984024,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/984011\/revisions\/984024"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/984021"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=984011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=984011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=984011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}