当pip显示下载超时的时候,请尝试:
pip install (要下载的包名) -i http://pypi.douban.com/simple
如果提示:
The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is
available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with
‘–trusted-host pypi.douban.com’.
<p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 26px;">请试试这个的办法:</p><div id="crayon-58175548f090e805401888" class="crayon-syntax crayon-theme-github crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" style="box-sizing: border-box; width: 708px; padding: 0px; margin: 12px 0px; font-family: Monaco, MonacoRegular, 'Courier New', monospace; color: rgb(85, 85, 85); height: auto; overflow: hidden !important; position: relative !important; direction: ltr !important; border: 1px solid rgb(222, 222, 222) !important; line-height: 24px !important; background-color: rgb(248, 248, 255) !important;"><div class="crayon-plain-wrap" style="border: 0px; padding: 0px !important; margin: 0px !important; height: auto !important; background: 0px 50%;"><textarea wrap="soft" class="crayon-plain print-no" data-settings="dblclick" readonly="readonly" style="margin: 0px; vertical-align: middle; overflow: hidden; height: 32px; padding-top: 0px; padding-right: 5px; padding-left: 5px; color: rgb(0, 0, 0); border-radius: 0px; width: 706px; border: 0px; transition: border 0.2s linear; position: absolute; opacity: 0; box-shadow: none; white-space: pre; word-wrap: normal; resize: none; tab-size: 4; z-index: 0; font-size: 12px !important; line-height: 24px !important; font-family: Monaco, MonacoRegular, 'Courier New', monospace !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"></textarea></div><div class="crayon-main" style="border: 0px; padding: 0px; margin: 0px; width: 706px; overflow: hidden; position: relative; z-index: 1; background: 0px 50%;"><table class="crayon-table " style="font-size: 12px; margin-left: 0px; border: none !important; padding: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-top: 0px !important; width: auto !important; border-spacing: 0px !important; border-collapse: collapse !important; table-layout: auto !important; background: none !important;"><tbody><tr class="crayon-row" style="padding: 0px !important; border: none !important; vertical-align: top !important; margin: 0px !important; background: 0px 50%;"><td class="crayon-nums " data-settings="show" style="font-family: Monaco, MonacoRegular, 'Courier New', monospace !important; vertical-align: top !important; border: 0px; padding: 0px !important; margin: 0px !important; background-image: initial; background-attachment: initial; background-color: rgb(238, 238, 238) !important; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 50%; background-repeat: initial;"><div class="crayon-nums-content" style="border: 0px; padding-right: 0px; padding-left: 0px; margin: 0px; white-space: nowrap; padding-top: 5px !important; padding-bottom: 3px !important; line-height: 24px !important; background: 0px 50%;"><div class="crayon-num" data-line="crayon-58175548f090e805401888-1" style="font-family: inherit; border-top-width: 0px; border-right-width: 1px !important; border-bottom-width: 0px; border-left-width: 0px; border-right-style: solid !important; border-right-color: rgb(222, 222, 222) !important; padding: 0px 5px; margin: 0px; text-align: right !important; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; min-width: 1.2em !important; color: rgb(170, 170, 170) !important; background: 0px 50%;">1</div></div></td><td class="crayon-code" style="font-family: Monaco, MonacoRegular, 'Courier New', monospace !important; vertical-align: top !important; border: 0px; padding: 0px !important; margin: 0px !important; width: 680px; background: 0px 50%;"><div class="crayon-pre" style="padding-right: 0px; padding-left: 0px; margin: 0px; white-space: pre; overflow: visible; tab-size: 4; border: none !important; padding-top: 5px !important; padding-bottom: 3px !important; line-height: 24px !important; background: none !important;"><div class="crayon-line" id="crayon-58175548f090e805401888-1" style="font-family: inherit; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; background: 0px 50%;"><span class="crayon-e" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: teal !important;">pip </span><span class="crayon-e" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: teal !important;">install </span><span class="crayon-v" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 45, 122) !important;">virtualenv</span><span class="crayon-h" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;"> </span><span class="crayon-o" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;">--</span><span class="crayon-v" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 45, 122) !important;">trusted</span><span class="crayon-o" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;">-</span><span class="crayon-e" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: teal !important;">host </span><span class="crayon-v" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 45, 122) !important;">pypi</span><span class="crayon-e" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: teal !important;">.douban</span><span class="crayon-e" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: teal !important;">.com</span><span class="crayon-h" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;"> </span><span class="crayon-o" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;">-</span><span class="crayon-i" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">i</span><span class="crayon-h" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;"> </span><span class="crayon-v" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 45, 122) !important;">http</span><span class="crayon-o" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;">:</span><span class="crayon-o" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;">/</span><span class="crayon-o" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;">/</span><span class="crayon-v" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 45, 122) !important;">pypi</span><span class="crayon-e" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: teal !important;">.douban</span><span class="crayon-e" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: teal !important;">.com</span><span class="crayon-o" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;">/</span><span class="crayon-v" style="font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 45, 122) !important;">simple</span></div></div></td></tr></tbody></table></div></div>
转载: 拈花古佛博客 » Python-pip使用国内镜像加速下载