问题:

安装包出现Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError

解决办法:

1 pip install selectivesearch -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

其他源总结:

通过几次pip的使用,对于默认的pip源的速度实在无法忍受,于是便搜集了一些国内的pip源,如下:

阿里云 http://mirrors.aliyun.com/pypi/simple/

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

豆瓣(douban) http://pypi.douban.com/simple/

清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/

中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

使用方法很简单,直接 -i 加 url 即可!如下:

1 # pip install web.py -i http://pypi.douban.com/simple

如果有如下报错:


请使用命令:

1 # pip install web.py -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

如果想配置成默认的源,方法如下:
需要创建或修改配置文件(一般都是创建),
linux的文件在~/.pip/pip.conf,
windows在%HOMEPATH%\pip\pip.ini)

创建解释:
python的pip的配置文件路径在哪里?如何修改pypi源?
官方文档:
 https://pip.pypa.io/en/stable/user_guide/#configuration
举个例子:
Windows用户想要更改pypi源,可以在%APPDATA%目录下新建pip文件夹,再在pip文件夹下新建pip.ini。
(如果路径中已经存在了文件夹或者文件,就不用创建了,另外你可以在cmd下输入"echo %APPDATA%"查看%APPDATA%代表的路径是哪)
当然也可以在%HOME%下进行新建,或许你有其他需要,可能也会在 %VIRTUAL_ENV% 或者 C:\Documents and Settings\ 或者 C:\ProgramData\ 目录下进行新建。
具体区别可以点击上方的官方文档链接进行查看。
如果想用清华大学的pypi源,那么pip.ini文件里面的内容可以这么写:
1 [global]
2 index-url = https://pypi.tuna.tsinghua.edu.cn/simple 
你也可以查看清华大学的pypi帮助文档:https://mirrors.tuna.tsinghua.edu.cn/help/pypi/

修改内容为:

[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host=pypi.douban.com

这样在使用pip来安装时,会默认调用该镜像。
临时使用其他源安装软件包的python脚本如下:

1 #!/usr/bin/python
2
3 import os
4
5 package = raw_input ( "Please input the package which you want to install!\n" )
6 command = "pip install %s -i http://pypi.mirrors.ustc.edu.cn/simple --trusted-host pypi.mirrors.ustc.edu.cn" % package
7 os.system(command)

python中pip安装包出现Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))…………或无法pip install packname安装依赖包的更多相关文章

  1. python使用pip安装模块出错 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None))

    python使用pip安装模块出错 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) 问题: ...

  2. pip安装第三方库报错Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None))...

    pip安装第三方库时报错Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None))...,详细报错见下 ...

  3. Python 安装第三方模块时 报Retrying(Retry(total=4, connect=None, read=None, redirect=None, status=None))...[WinError 10061]由于目标计算机积极拒绝,无法连接 错误

    今日在安装ddt模块时(Windows系统),cmd报了一个以前从未见过的错误,如下图所示: 经百度,知是镜像源的问题,将安装命令改成如下命令: pip install ddt -i https:// ...

  4. pip安装报错: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy

    pip安装报错 解决办法: pip install selenium -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

  5. 在安装python 第三方库时遇到【WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, st】问题

    在命令执行窗输入: pip install Pyinstaller -i http://pypi.douban.com/simple --trusted-host pypi.douban.com (其 ...

  6. pip安装包出现timeout的解决办法

    今天安装django时老是出现timeout WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, sta ...

  7. 【python】 Windows下pip安装包报错:Microsoft Visual C++ 9.0 is required Unable to find vcvarsall.bat

    刚在机器上windows环境下装上pip方便以后安装包的时候使用,谁知道第一次使用pip安装asyncio的时候就报错. 在Windows7x64下使用pip安装包的时候提示报错:Microsoft ...

  8. pip安装包报错:Microsoft Visual C++ 9.0 is required Unable to find vcvarsall.bat

    pip安装包报错:Microsoft Visual C++ 9.0 is required Unable to find vcvarsall.bat Windows7下pip安装包报错:Microso ...

  9. Windows下pip安装包报错:Microsoft Visual C++ 9.0 is required Unable to find vcvarsall.bat

    刚在机器上windows环境下装上pip方便以后安装包的时候使用,谁知道第一次使用pip安装asyncio的时候就报错. 在Windows7x64下使用pip安装包的时候提示报错:Microsoft ...

  10. (转)Windows下pip安装包报错:Microsoft Visual C++ 9.0 is required Unable to find vcvarsall.bat

    刚在机器上windows环境下装上pip方便以后安装包的时候使用,谁知道第一次使用pip安装asyncio的时候就报错. 在Windows7x64下使用pip安装包的时候提示报错:Microsoft ...

随机推荐

  1. vscode开发一个luaIDE插件

    基础知识 环境准备 node.js 下载后下一步下一步即可安装成功,推荐LTS版本 yeoman 脚手架工具,也就是快速帮你新建一个插件所需的目录的工具,在工作目录下cmd,输入下列命令即可安装 np ...

  2. RHCSA认证学习_尝试

    第一天 一,linux系统的基本概念以及命令终端字段含义介绍 linux系统的基本概念: ·多用户的系统:允许同时执行多个任务 ·多任务的系统:允许同时执行多个任务 ·严格区分大小写:命令,选项,参数 ...

  3. LTSC系统,唯一未被微软宣传过,却备受用户赞誉,CPU占用暴降

    微软拥有多款操作系统,如Windows XP.Windows 7.Windows 10以及最新的Windows 11等. 其中,Windows XP和Windows 7因其稳定性和用户友好性而广受好评 ...

  4. vscode git bash终端配置:“”message": "此项已弃用,配置默认 shell 的新推荐方法是在 `#terminal.integrated.profiles.windows#

    当VSCode升级至1.57.1(2021.6.17)时,会出现警告提示:""message": "此项已弃用,配置默认 shell 的新推荐方法是在 `#te ...

  5. jquery的循环 tab切换

        <ul>         <li>1</li>         <li>2</li>         <li>3< ...

  6. 带你了解磁盘驱动程序(xv6)

    磁盘驱动程序 本文来聊聊磁盘驱动程序,驱动程序是硬件的接口,操作系统通过这个接口来控制硬件工作,所以驱动程序就好比是硬件和系统之间的桥梁.这是百科上给出的解释,可能看起来还是云里雾里,我来做做注解. ...

  7. LeetCode 460. LFU Cache LFU缓存 (C++/Java)

    题目: Design and implement a data structure for Least Frequently Used (LFU)cache. It should support th ...

  8. 小米 红米 MIUI 重新打开(开启)蓝牙耳机电量弹窗

    原本关闭了下拉通知栏,显示耳机电量的窗口.想重新开开启. 解决方法: 1.确保小爱同学开了通知权限. 2.在蓝牙-高级设置里-开启"小米快连" 3.手机是解锁状态(非锁屏),耳机需 ...

  9. Vue学习:1.V标签综合1

    认识V标签 目录 认识V标签 v-text: v-html: v-bind (缩写为 :): v-if / v-else / v-else-if: v-show: v-for: v-model: Vu ...

  10. Java api zookeeper

    package com.redis.demo.zookeeper; import java.io.Serializable; public class User implements Serializ ...