【问题标题】:Pip on Windows won't install anythingWindows 上的 Pip 不会安装任何东西
【发布时间】:2019-07-01 16:56:54
【问题描述】:

我正在尝试在 Windows 10 机器上安装带有 numpy 和 openCV 的 Python 3.6。我安装了带有 pip 18.1 的 python 3.6.8。当我尝试使用 pip 安装任何东西时,无论包如何,我都会得到相同的结果:

C:\WINDOWS\system32>pip install numpy
Collecting numpy
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D135A3AE48>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/numpy/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D135A3ABE0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/numpy/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D135A3A8D0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/numpy/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D135A3A7B8>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/numpy/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D135A3A9B0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/numpy/
  Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy

我尝试更新 pip,它告诉我它已经是最新的。怎么回事?

【问题讨论】:

    标签: python-3.x windows pip


    【解决方案1】:

    我想通了。这是我公司网络上的一些代理问题。在 pip install numpy 工作后使用 --proxy。

    【讨论】:

      【解决方案2】:

      请试试这个代码

      python3 -m pip install <pkg>
      

      【讨论】:

      • 这是我得到的:C:\Users\tglenn17>python3 -m pip install numpy 'python3' 不是内部或外部命令、可运行程序或批处理文件。我试过“python -m pip install numpy”,它和我刚刚做“pip install numpy”时的效果一样
      • 在命令提示符下,您必须首先进入“脚本”文件夹。类似 cd C:.....\Programs\Python\Python37-32\Scripts。您必须找到 Scripts 文件夹的路径。如果你在文件夹中搜索,你会得到。之后尝试 pip install 命令
      【解决方案3】:

      试试这个代码。这会将 pypi.org 和 files.pythonhosted.org 设置为受信任的主机以忽略 SSL 错误。 pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org

      这个问题的答案:pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)"

      【讨论】:

        猜你喜欢
        • 2012-09-11
        • 1970-01-01
        • 2013-06-29
        • 2018-09-20
        • 1970-01-01
        • 1970-01-01
        • 2018-05-17
        • 2018-09-10
        • 2018-10-04
        相关资源
        最近更新 更多