此文首发于我的个人博客:报错解决 RequestsDependencyWarning urllib3 (1.24.3) or chardet (3.0.4) doesn’t match a supported version! — zhang0peter的个人博客


下午在用Python的requests库跑爬虫时遇到报错:

/usr/lib/python3/dist-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.24.3) or chardet (3.0.4) doesn't match a supported version!RequestsDependencyWarning)
Traceback (most recent call last):File "/usr/local/lib/python3.6/dist-packages/urllib3/connection.py", line 159, in _new_conn(self._dns_host, self.port), self.timeout, **extra_kw)File "/usr/local/lib/python3.6/dist-packages/urllib3/util/connection.py", line 80, in create_connectionraise errFile "/usr/local/lib/python3.6/dist-packages/urllib3/util/connection.py", line 70, in create_connectionsock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refusedDuring handling of the above exception, another exception occurred:Traceback (most recent call last):File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 594, in urlopenself._prepare_proxy(conn)File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 805, in _prepare_proxyconn.connect()File "/usr/local/lib/python3.6/dist-packages/urllib3/connection.py", line 301, in connectconn = self._new_conn()File "/usr/local/lib/python3.6/dist-packages/urllib3/connection.py", line 168, in _new_connself, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f022a48c160>: Failed to establish a new connection: [Errno 111] Connection refusedDuring handling of the above exception, another exception occurred:Traceback (most recent call last):File "/usr/lib/python3/dist-packages/requests/adapters.py", line 440, in sendtimeout=timeoutFile "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 638, in urlopen_stacktrace=sys.exc_info()[2])File "/usr/local/lib/python3.6/dist-packages/urllib3/util/retry.py", line 399, in incrementraise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.youtube.com', port=443): Max retries exceeded with url: /channel/UC6UjHs0PLnmXvffsmFGpLXw/about (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f022a48c160>: Failed to establish a new connection: [Errno 111] Connection refused',)))During handling of the above exception, another exception occurred:Traceback (most recent call last):File "youtube-spider/youtube-channel-spider.py", line 191, in <module>requests_get_channel_data(url=channel_url)File "youtube-spider/youtube-channel-spider.py", line 73, in requests_get_channel_datar = requests.get(url=url, headers=head, proxies=proxy)File "/usr/lib/python3/dist-packages/requests/api.py", line 72, in getreturn request('get', url, params=params, **kwargs)File "/usr/lib/python3/dist-packages/requests/api.py", line 58, in requestreturn session.request(method=method, url=url, **kwargs)File "/usr/lib/python3/dist-packages/requests/sessions.py", line 520, in requestresp = self.send(prep, **send_kwargs)File "/usr/lib/python3/dist-packages/requests/sessions.py", line 630, in sendr = adapter.send(request, **kwargs)File "/usr/lib/python3/dist-packages/requests/adapters.py", line 502, in sendraise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.youtube.com', port=443): Max retries exceeded with url: /channel/UC6UjHs0PLnmXvffsmFGpLXw/about (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f022a48c160>: Failed to establish a new connection: [Errno 111] Connection refused',)))

然后我先查询了RequestsDependencyWarning: urllib3 (1.24.3) or chardet (3.0.4) doesn't match a supported version!
网上的解决方法是重新安装库,切换版本。

pip install --upgrade urllib3==1.24.3

然后我发现这是一个Warning,不是error,所以应该还有其他问题。

我查看了代码,发现我本地代码设置了代理,而服务器上的没有代理,我没有取消代理,自然报错了。
程序正常运行后依然有Warning,但可以顺利运行了。

/usr/lib/python3/dist-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.24.3) or chardet (3.0.4) doesn't match a supported version!RequestsDependencyWarning)

报错解决:RequestsDependencyWarning: urllib3 (1.24.3) or chardet (3.0.4) doesn't match a supported versio相关推荐

  1. RequestsDependencyWarning: urllib3 (1.26.9) or chardet (3.0.4) doesn‘t match a supported version

    请求依赖警告:urllib3 (1.26.9) 或者 chardet (3.0.4)与支持的版本不匹配! RequestsDependencyWarning: urllib3 (1.26.9) or ...

  2. 报错解决:urllib3.exceptions.MaxRetryError

    今天使用requests异步加载抓取数据的时候报错: urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', po ...

  3. CentOS 6.3 下编译cyrus-sasl报错解决

    编译cyrus-sasl报错解决        分类:            Linux2011-12-07 12:501155人阅读评论(0)收藏举报 function 编译cyrus-sasl报错 ...

  4. 风格迁移1-02:Liquid Warping GAN(Impersonator)-源码模型测试-报错解决

    以下链接是个人关于Liquid Warping GAN(Impersonator)-姿态迁移,所有见解,如有错误欢迎大家指出,我会第一时间纠正.有兴趣的朋友可以加微信:17575010159 相互讨论 ...

  5. Redis server went away报错解决

    redis:Redis server went away报错解决 1.查看redis.conf 绑定ip是否为0.0.0.0默认是127.0.0.1 如果127.0.0.1 redis-cli 连接时 ...

  6. Thinkphp安装报错解决办法

    跟着官方文档的步骤安装thinkphp报错该如何解决: 前言 ThinkPHP无需安装过程,但是需要把ThinkPHP框架放入WEB运行环境(前提是你的WEB运行环境没有问题). 一.Thinkphp ...

  7. urllib3 (1.26.4) or chardet (4.0.0) doesn‘t match a supported version!

    Python脚本执行时requests依赖包警告: C:\Python36\lib\site-packages\requests\__init__.py:80: RequestsDependencyW ...

  8. Python报错pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool解决方法

    在安装第三方库的时候,Python报错pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files. ...

  9. Python安装库较慢问题,Python报错pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool解决方法

    本文参考:https://blog.csdn.net/sinat_26811377/article/details/99698807 出现问题 在安装第三方库的时候,Python报错pip._vend ...

最新文章

  1. myeclipse 2016 ci3破解教程(含软件下载)
  2. 查看oracle会话和进程_带有Oracle Digital Assistant和Fn Project的会话式UI
  3. Unicode和Utf-8
  4. Django使用mysql连接池_Django db使用MySQL连接池
  5. Ubuntu LVS DR模式生产环境部署
  6. 《数据资产管理实践白皮书(5.0版)》正式发布,附下载链接
  7. 如何利用docker 构建golang线上部署环境
  8. 作为 SaaS 初创公司产品负责人,我学到了 5 条经验教训!
  9. centos7 配置anaconda及anaconda常用命令
  10. Mysql的安全设置
  11. Java读取TXT文件中文输出乱码
  12. GitHub上最全中华古诗词数据库又火了
  13. matlab——取整函数
  14. python调用bash shell脚本
  15. 物理机是什么?跟云服务器有什么区别
  16. uninstall和install
  17. Ptolemy 11-28
  18. 路由器(交换机)的光口和电口
  19. http.client.InvalidURL: nonnumeric port: 'yourport' 运行报错 求大神指点。。。。。。实在是不知道怎么弄了
  20. 你在自学软件测试吗?学软件测试10本必看书

热门文章

  1. Nat. Med. | 制定指导原则以报告AI在临床试验中的使用
  2. 基于python爬虫数据处理_基于Python爬虫的校园数据获取
  3. python 文件路径_「按需学Python」 1. Glob库遍历路径/文件
  4. ISME:西农沈锡辉+韦革宏+王瑶揭示细菌铁获取和外膜囊泡招募新机制
  5. Nature:运动能力与空间竞争驱动的细菌共存及机制解析
  6. MetaPhlAn2:宏基因组物种组成分析
  7. SR:嗜酸古菌的代谢和进化模式
  8. 美国辛辛那堤儿童医学中心招生物信息博士, 博士后和访问学者——单细胞转录组和表观方向...
  9. Microbiome:HiSeq平台16S扩增子超高通量测序文库构建方法
  10. R语言使用pwr包的pwr.f2.test函数对线性回归模型进行效用分析(power analysis)、在已知效应量(effect size)、显著性水平、效用值的情况下计算需要的样本量