博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
安装python下的requests包出错
阅读量:6540 次
发布时间:2019-06-24

本文共 4127 字,大约阅读时间需要 13 分钟。

环境:

mac os: 10.13.6

python:2.7.10

virtualenv

$ pip install requests

Collecting requests

  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x109cfa510>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',)': /packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl

  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x109cfa750>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',)': /packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl

  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x109cfa890>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',)': /packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl

  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x109cfa910>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',)': /packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl

  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x109cfa9d0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',)': /packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl

Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl (Caused by NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x109cfaad0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',))

 解决,有可能是网络问题造成。

$ pip install requests -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

Looking in indexes: http://pypi.douban.com/simple/

Collecting requests

  Downloading http://pypi.doubanio.com/packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl (91kB)

    100% |████████████████████████████████| 92kB 1.3MB/s 

Collecting certifi>=2017.4.17 (from requests)

  Downloading http://pypi.doubanio.com/packages/df/f7/04fee6ac349e915b82171f8e23cee63644d83663b34c539f7a09aed18f9e/certifi-2018.8.24-py2.py3-none-any.whl (147kB)

    100% |████████████████████████████████| 153kB 2.1MB/s 

Collecting chardet<3.1.0,>=3.0.2 (from requests)

  Downloading http://pypi.doubanio.com/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)

    100% |████████████████████████████████| 143kB 5.6MB/s 

Requirement already satisfied: urllib3<1.24,>=1.21.1 in ./.virtualenvs/python_2/lib/python2.7/site-packages (from requests) (1.23)

Collecting idna<2.8,>=2.5 (from requests)

  Downloading http://pypi.doubanio.com/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl (58kB)

    100% |████████████████████████████████| 61kB 5.5MB/s 

Installing collected packages: certifi, chardet, idna, requests

Successfully installed certifi-2018.8.24 chardet-3.0.4 idna-2.7 requests-2.19.1

转载于:https://www.cnblogs.com/herosoft/p/9741748.html

你可能感兴趣的文章
事务之六:spring 嵌套事务
查看>>
C#:路径
查看>>
iOS图片加载速度极限优化—FastImageCache解析
查看>>
PHP中的一些新特性
查看>>
I.MX6 Android mmm convenient to use
查看>>
55、Android网络图片 加载缓存处理库的使用
查看>>
【转载】千万级规模高性能、高并发的网络架构经验分享
查看>>
OC基础--OC中的类方法和对象方法
查看>>
ubuntu samba服务器多用户配置【转】
查看>>
母线的种类与作用是什么(转)
查看>>
【Xamarin 挖墙脚系列:IOS 开发界面的3种方式】
查看>>
Atitit.工作流系统的本质是dsl 图形化的dsl 4gl
查看>>
I.MX6 Android USB Touch eGTouchA.ini文件存放
查看>>
4-5-创建索引表-串-第4章-《数据结构》课本源码-严蔚敏吴伟民版
查看>>
java 操作 RabbitMQ 发送、接受消息
查看>>
go run main.go undefined? golang main包那点事
查看>>
从零开始写一个npm包,一键生成react组件(偷懒==提高效率)
查看>>
Volley(二)—— 基本Request对象 & RequestQueue&请求取消
查看>>
2017中国系统架构师大会“盛装”来袭
查看>>
中国最强的人工智能学术会议来了
查看>>