鱼C论坛

 找回密码
 立即注册
查看: 930|回复: 10

[已解决]requests安装失败,请各位大神帮忙解决!!!

[复制链接]
发表于 2020-3-8 16:06:18 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>pip install requests
Collecting requests
  Using cached https://files.pythonhosted.org/p ... y2.py3-none-any.whl
Collecting idna<3,>=2.5 (from requests)
  Downloading https://files.pythonhosted.org/p ... y2.py3-none-any.whl (58kB)


ERROR: Exception:
Traceback (most recent call last):
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 360, in _error_catcher
    yield
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 442, in read
    data = self._fp.read(amt)
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
    data = self.__fp.read(amt)
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\http\client.py", line 447, in read
    n = self.readinto(b)
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\http\client.py", line 491, in readinto
    n = self.fp.readinto(b)
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\socket.py", line 589, in readinto
    return self._sock.recv_into(b)
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\ssl.py", line 1052, in recv_into
    return self.read(nbytes, buffer)
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\ssl.py", line 911, in read
    return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\cli\base_command.py", line 178, in main
    status = self.run(options, args)
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\commands\install.py", line 352, in run
    resolver.resolve(requirement_set)
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\resolve.py", line 131, in resolve
    self._resolve_one(requirement_set, req)
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\resolve.py", line 294, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\resolve.py", line 242, in _get_abstract_dist_for
    self.require_hashes
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\operations\prepare.py", line 347, in prepare_linked_requirement
    progress_bar=self.progress_bar
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\download.py", line 886, in unpack_url
    progress_bar=progress_bar
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\download.py", line 746, in unpack_http_url
    progress_bar)
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\download.py", line 954, in _download_http_url
    _download_url(resp, link, content_file, hashes, progress_bar)
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\download.py", line 683, in _download_url
    hashes.check_against_chunks(downloaded_chunks)
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\utils\hashes.py", line 62, in check_against_chunks
    for chunk in chunks:
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\download.py", line 651, in written_chunks
    for chunk in chunks:
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\utils\ui.py", line 156, in iter
    for x in it:
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\download.py", line 640, in resp_read
    decode_content=False):
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 494, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 459, in read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 365, in _error_catcher
    raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

C:\Users\Administrator>










































































Regular癤&#2048;>&#8224; 
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2020-3-8 16:41:07 From FishC Mobile | 显示全部楼层
好像是超时
要么多试几次
要么换镜像源
要么下载whl手动安装
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-3-8 17:13:37 | 显示全部楼层
估计是网速太差,或者国外的源不稳定。如果是python3.X,采用国内的阿里镜像即可,就用如下命令:
pip3 install 模块名称 -i http://mirrors.aliyun.com/pypi/simple
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-3-8 17:22:20 | 显示全部楼层    本楼为最佳答案   
参考我这篇帖子:https://fishc.com.cn/thread-159245-1-1.html
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-3-8 17:36:02 | 显示全部楼层
请参考这篇帖子提高 pip 的安装速度后再尝试安装:https://fishc.com.cn/thread-143635-1-1.html
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 1 反对 0

使用道具 举报

发表于 2020-3-8 20:25:27 | 显示全部楼层
换清华的源
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-3-13 22:54:30 | 显示全部楼层
wp231957 发表于 2020-3-8 16:41
好像是超时
要么多试几次
要么换镜像源

WARNING: The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host mirrors.aliyun.com'.

还是不行,请大神再指点一下  我哪里出错了  谢谢
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-3-13 22:55:17 | 显示全部楼层

我没有清华的源  求包
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-3-13 22:59:40 | 显示全部楼层
Cymatics 发表于 2020-3-8 17:13
估计是网速太差,或者国外的源不稳定。如果是python3.X,采用国内的阿里镜像即可,就用如下命令:
pip3 in ...

C:\Users\Administrator>pip3 install requests -i http://mirrors.aliyun.com/pypi/simple


WARNING: The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host mirrors.aliyun.com'.

还是不行  请大神指点  谢谢
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-3-14 07:15:54 | 显示全部楼层
你在下载设置里就可以换
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-3-14 22:36:21 | 显示全部楼层
zltzlt 发表于 2020-3-8 17:36
请参考这篇帖子提高 pip 的安装速度后再尝试安装:https://fishc.com.cn/thread-143635-1-1.html

谢谢  按照你的方法已经解决
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-11-24 20:48

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表