Python:pip在尝试安装软件包时吐出长错误

时间:2016-10-14 23:36:30

标签: python windows python-3.x pip command-prompt

只是尝试安装具有依赖关系的pyautogui模块;图片。尝试在命令提示符下通过pip安装Image时,出现此错误:

Traceback (most recent call last):
  File "c:\program files (x86)\python35-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 226, in _error_catcher
    yield
  File "c:\program files (x86)\python35-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 301, in read
    data = self._fp.read(amt)
  File "c:\program files (x86)\python35-32\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 49, in read
    data = self.__fp.read(amt)
  File "c:\program files (x86)\python35-32\lib\http\client.py", line 448, in read
    n = self.readinto(b)
  File "c:\program files (x86)\python35-32\lib\http\client.py", line 488, in readinto
    n = self.fp.readinto(b)
  File "c:\program files (x86)\python35-32\lib\socket.py", line 575, in readinto
    return self._sock.recv_into(b)
  File "c:\program files (x86)\python35-32\lib\ssl.py", line 929, in recv_into
    return self.read(nbytes, buffer)
  File "c:\program files (x86)\python35-32\lib\ssl.py", line 791, in read
    return self._sslobj.read(len, buffer)
  File "c:\program files (x86)\python35-32\lib\ssl.py", line 575, in read
    v = 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:\program files (x86)\python35-32\lib\site-packages\pip\basecommand.py", line 209, in main
    status = self.run(options, args)
  File "c:\program files (x86)\python35-32\lib\site-packages\pip\commands\install.py", line 299, in run
    requirement_set.prepare_files(finder)
  File "c:\program files (x86)\python35-32\lib\site-packages\pip\req\req_set.py", line 360, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "c:\program files (x86)\python35-32\lib\site-packages\pip\req\req_set.py", line 577, in _prepare_file
    session=self.session, hashes=hashes)
  File "c:\program files (x86)\python35-32\lib\site-packages\pip\download.py", line 810, in unpack_url
    hashes=hashes
  File "c:\program files (x86)\python35-32\lib\site-packages\pip\download.py", line 649, in unpack_http_url
    hashes)
  File "c:\program files (x86)\python35-32\lib\site-packages\pip\download.py", line 871, in _download_http_url
    _download_url(resp, link, content_file, hashes)
  File "c:\program files (x86)\python35-32\lib\site-packages\pip\download.py", line 595, in _download_url
    hashes.check_against_chunks(downloaded_chunks)
  File "c:\program files (x86)\python35-32\lib\site-packages\pip\utils\hashes.py", line 46, in check_against_chunks
    for chunk in chunks:
  File "c:\program files (x86)\python35-32\lib\site-packages\pip\download.py", line 563, in written_chunks
    for chunk in chunks:
  File "c:\program files (x86)\python35-32\lib\site-packages\pip\utils\ui.py", line 139, in iter
    for x in it:
  File "c:\program files (x86)\python35-32\lib\site-packages\pip\download.py", line 552, in resp_read
    decode_content=False):
  File "c:\program files (x86)\python35-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 344, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "c:\program files (x86)\python35-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 311, in read
    flush_decoder = True
  File "c:\program files (x86)\python35-32\lib\contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "c:\program files (x86)\python35-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 231, in _error_catcher
    raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.

这真的很长而且令人困惑,pip与python2.7一起使用,但是自从我更新到3.5后,它一直在为我尝试通过pip安装的所有软件包执行此操作。

0 个答案:

没有答案