{"id":200,"date":"2025-03-16T15:56:46","date_gmt":"2025-03-16T07:56:46","guid":{"rendered":"https:\/\/pc.wuhanioe.com\/index.php\/2025\/03\/16\/pip-%e5%ae%89%e8%a3%85%e8%b6%85%e6%97%b6%e5%a4%b1%e8%b4%a5%ef%bc%9f%e9%95%9c%e5%83%8f%e6%ba%90%e3%80%81%e4%bb%a3%e7%90%86%e4%b8%8e%e7%bc%93%e5%ad%98%e7%9a%84%e5%ae%9e%e7%94%a8%e8%a7%a3%e5%86%b3\/"},"modified":"2025-03-16T15:56:46","modified_gmt":"2025-03-16T07:56:46","slug":"pip-%e5%ae%89%e8%a3%85%e8%b6%85%e6%97%b6%e5%a4%b1%e8%b4%a5%ef%bc%9f%e9%95%9c%e5%83%8f%e6%ba%90%e3%80%81%e4%bb%a3%e7%90%86%e4%b8%8e%e7%bc%93%e5%ad%98%e7%9a%84%e5%ae%9e%e7%94%a8%e8%a7%a3%e5%86%b3","status":"publish","type":"post","link":"https:\/\/pc.wuhanioe.com\/index.php\/2025\/03\/16\/pip-%e5%ae%89%e8%a3%85%e8%b6%85%e6%97%b6%e5%a4%b1%e8%b4%a5%ef%bc%9f%e9%95%9c%e5%83%8f%e6%ba%90%e3%80%81%e4%bb%a3%e7%90%86%e4%b8%8e%e7%bc%93%e5%ad%98%e7%9a%84%e5%ae%9e%e7%94%a8%e8%a7%a3%e5%86%b3\/","title":{"rendered":"pip \u5b89\u88c5\u8d85\u65f6\u5931\u8d25\uff1f\u955c\u50cf\u6e90\u3001\u4ee3\u7406\u4e0e\u7f13\u5b58\u7684\u5b9e\u7528\u89e3\u51b3\u624b\u518c"},"content":{"rendered":"<p>Python \u65b0\u624b\u6700\u5e38\u5361\u5728 <code>pip install<\/code> \u7684\u7ea2\u8272\u8d85\u65f6\uff1a<code>Read timed out<\/code>\u3001<code>ConnectionError<\/code>\u3002\u8fd9\u901a\u5e38\u662f\u7f51\u7edc\u5230\u5b98\u65b9\u6e90 PyPI \u4e0d\u7a33\u5b9a\u6240\u81f4\uff0c\u800c\u975e\u4ee3\u7801\u95ee\u9898\u3002\u4e0b\u9762\u4ece\u6e90\u3001\u53c2\u6570\u5230\u73af\u5883\u9010\u5c42\u89e3\u51b3\u3002<\/p>\n<h2>\u4e00\u3001\u6362\u6210\u79bb\u4f60\u66f4\u8fd1\u7684\u955c\u50cf\u6e90<\/h2>\n<p><strong>\u628a\u9ed8\u8ba4 PyPI \u6362\u6210\u56fd\u5185\u955c\u50cf\u662f\u6700\u7acb\u7aff\u89c1\u5f71\u7684\u529e\u6cd5<\/strong>\u3002\u4e34\u65f6\u4f7f\u7528\uff1a<\/p>\n<ol>\n<li><code>pip install \u5305\u540d -i https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/code><\/li>\n<li>\u963f\u91cc\u4e91\uff1a<code>https:\/\/mirrors.aliyun.com\/pypi\/simple<\/code>\uff1b\u4e2d\u79d1\u5927\uff1a<code>https:\/\/pypi.mirrors.ustc.edu.cn\/simple<\/code><\/li>\n<li>\u6c38\u4e45\u751f\u6548\uff1a\u65b0\u5efa <code>%APPDATA%\\pip\\pip.conf<\/code>\uff08Windows\uff09\u6216 <code>~\/.pip\/pip.conf<\/code>\uff08Linux\/macOS\uff09\uff0c\u5199\u5165 <code>[global] index-url = https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/code>\u3002<\/li>\n<\/ol>\n<h2>\u4e8c\u3001\u8c03\u5927\u8d85\u65f6\u4e0e\u91cd\u8bd5<\/h2>\n<p>\u7f51\u7edc\u6162\u65f6\u9ed8\u8ba4 15 \u79d2\u592a\u77ed\u3002\u52a0\u53c2\u6570\u653e\u5bbd\uff1a<\/p>\n<ol>\n<li><code>pip install \u5305\u540d --default-timeout=120<\/code> \u907f\u514d\u4e2d\u9014\u65ad\u5f00\u3002<\/li>\n<li>\u52a0 <code>--retries 10<\/code> \u4e0e <code>--timeout 120<\/code> \u63d0\u5347\u5065\u58ee\u6027\u3002<\/li>\n<\/ol>\n<h2>\u4e09\u3001\u516c\u53f8\u7f51\u7edc\u4e0b\u7684\u4ee3\u7406\u8bbe\u7f6e<\/h2>\n<p><strong>\u82e5\u5904\u5728\u9700\u8981\u4ee3\u7406\u7684\u5185\u7f51\uff0cpip \u4e0d\u4f1a\u81ea\u52a8\u8bfb\u7cfb\u7edf\u4ee3\u7406<\/strong>\u3002\u663e\u5f0f\u6307\u5b9a\uff1a<\/p>\n<ol>\n<li><code>pip install \u5305\u540d --proxy http:\/\/user:pass@host:port<\/code><\/li>\n<li>\u6216\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf <code>set HTTP_PROXY=...<\/code> \u4e0e <code>set HTTPS_PROXY=...<\/code> \u540e\u518d\u5b89\u88c5\u3002<\/li>\n<\/ol>\n<h2>\u56db\u3001\u79bb\u7ebf\u73af\u5883\u4e0e\u7f13\u5b58\u590d\u7528<\/h2>\n<ol>\n<li>\u6709\u7f51\u673a\u5668\u5148 <code>pip download \u5305\u540d -d .\/wheels<\/code> \u4e0b\u8f7d\u79bb\u7ebf\u5305\uff0c\u518d\u5230\u65e0\u7f51\u673a\u5668 <code>pip install --no-index --find-links .\/wheels \u5305\u540d<\/code>\u3002<\/li>\n<li>\u672c\u673a\u5df2\u6709\u7f13\u5b58\u65f6\u52a0 <code>--cache-dir<\/code> \u6307\u5b9a\uff0c\u6216\u7528 <code>pip install --upgrade<\/code> \u590d\u7528\u5df2\u4e0b\u8f7d\u7684 wheel \u907f\u514d\u91cd\u590d\u62c9\u53d6\u3002<\/li>\n<\/ol>\n<h2>\u4e94\u3001\u7248\u672c\u4e0e\u89e3\u6790\u5931\u8d25<\/h2>\n<p>\u62a5\u9519 <code>Could not find a version<\/code> \u591a\u56e0 Python \u7248\u672c\u8fc7\u4f4e\u6216\u5305\u540d\u62fc\u9519\u3002\u7528 <code>python --version<\/code> \u6838\u5bf9\uff0c\u5fc5\u8981\u65f6\u521b\u5efa\u865a\u62df\u73af\u5883\uff1a<code>python -m venv venv<\/code> \u540e\u6fc0\u6d3b\u518d\u88c5\uff0c\u9694\u79bb\u7cfb\u7edf\u4f9d\u8d56\u51b2\u7a81\u3002<\/p>\n<p><strong>\u6280\u672f\u5c0f\u7ed3\uff1a<\/strong>pip \u7f51\u7edc\u5931\u8d25\u7684\u672c\u8d28\u662f\u300e\u6e90\u8fdc\u3001\u8d85\u65f6\u77ed\u3001\u4ee3\u7406\u7f3a\u300f\u3002\u6362\u955c\u50cf\u3001\u52a0\u8d85\u65f6\u3001\u914d\u4ee3\u7406\u4e09\u6b65\u8986\u76d6\u7edd\u5927\u591a\u6570\u573a\u666f\uff1b\u79bb\u7ebf\u73af\u5883\u7528 download\/find-links \u8f6c\u79fb\u5b89\u88c5\uff0cworkon \u865a\u62df\u73af\u5883\u5219\u80fd\u89c4\u907f\u7248\u672c\u9519\u914d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5207\u6362\u56fd\u5185\u955c\u50cf\u3001\u914d\u7f6e\u8d85\u65f6\u4e0e\u4ee3\u7406\u3001\u5584\u7528\u7f13\u5b58\uff0c\u6839\u6cbb pip \u7f51\u7edc\u5b89\u88c5\u5931\u8d25\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-200","post","type-post","status-publish","format-standard","hentry","category-3"],"_links":{"self":[{"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/posts\/200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/comments?post=200"}],"version-history":[{"count":0,"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/posts\/200\/revisions"}],"wp:attachment":[{"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/media?parent=200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/categories?post=200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/tags?post=200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}