代码之家  ›  专栏  ›  技术社区  ›  ViaTech

使用Pip3安装时出现问题

  •  0
  • ViaTech  · 技术社区  · 6 年前

    我遇到了一个奇怪的问题,我还没有找到解决办法。

    我刚刚在一个新系统上安装了ubuntubudgei,我正在使用Python 3.6建立一个开发环境,但是出于某种原因 pip3 运行时未在我的项目中安装程序包 pip3 install ,它只是挂着。

    pip3 install django
    Collecting django
      Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)",)': /simple/django/
      Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)",)': /simple/django/
    

    我已经卸载并重新安装了pip3,重新启动了我的电脑,似乎什么也没用,我对下一步该做什么一无所知。

    我不是通过代理连接的,这只是标准internet,我可以成功地ping其他站点并查看internet,因此这不应该是一个整体连接问题。有人知道吗?

    更新

    pip3 install django -vvv
    Collecting django
      1 location(s) to search for versions of django:
      * https://pypi.python.org/simple/django/
      Getting page https://pypi.python.org/simple/django/
      Looking up "https://pypi.python.org/simple/django/" in the cache
      Returning cached "301 Moved Permanently" response (ignoring date and etag information)
      Looking up "https://pypi.org/simple/django/" in the cache
      No cache entry available
      Starting new HTTPS connection (1): pypi.org
      Incremented Retry for (url='/simple/django/'): Retry(total=4, connect=None, read=None, redirect=None, status=None)
      Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)",)': /simple/django/
      Starting new HTTPS connection (2): pypi.org
    
    1 回复  |  直到 6 年前
        1
  •  1
  •   Sumukha Pk    6 年前

    前几天我也发生了同样的事情。我认为这是一个互联网问题,但我可以从终端ping,并在浏览器上访问web。但事实证明这是一个网络问题,在我重启电脑后,一切都很好。

    我又试了一次,当它找到一个合适的网络连接时,它就自己重置了(我这里的网络有点劣质)。

    Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. PS C:\Users\SUMUKHAs PC> pip install django Collecting django Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x00000237E11C7FD0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/django/ Operation cancelled by user PS C:\Users\SUMUKHAs PC> pip install scikit-learn Collecting scikit-learn Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/scikit-learn/ Downloading https://files.pythonhosted.org/packages/74/fc/e3d24a3472e32102f9f667adf05a41fdd5b56893f34464f06c8549684cd5/scikit_learn-0.20.1-cp37-cp37m-win_amd64.whl (4.8MB) Operation cancelled by user PS C:\Users\SUMUKHAs PC> pip install scikit-learn Collecting scikit-learn Downloading https://files.pythonhosted.org/packages/74/fc/e3d24a3472e32102f9f667adf05a41fdd5b56893f34464f06c8549684cd5/scikit_learn-0.20.1-cp37-cp37m-win_amd64.whl (4.8MB) 9% |███ | 471kB 2.7kB/s eta 0:26:16