Python-无法在Windows上安装pip - 找不到匹配

时间:2017-08-30 12:43:10

标签: python windows python-2.7 pip

我正在尝试在Windows 8上安装pip库。当前的python版本 - 2.7.3。我从https://pip.pypa.io/en/stable/installing/

下载了get-pip.py.

执行以下命令时,在命令提示符下(以管理员身份) Python get-pip.py,我得到以下错误。我在公司网络上运行它。这个命令是否指望我提供ip地址?我试着寻找解决方案,但无法得到满意的答案。有解决方案吗?如果没有,有什么替代方案吗?请建议

C:\windows\system32>cd C:\Python27

C:\Python27>python get-pip.py
Collecting pip
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connec
tion broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.conne
ction.VerifiedHTTPSConnection object at 0x03654450>: Failed to establish a new c
onnection: [Errno 10061] No connection could be made because the target machine
actively refused it',)': /simple/pip/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connec
tion broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.conne
ction.VerifiedHTTPSConnection object at 0x03654490>: Failed to establish a new c
onnection: [Errno 10061] No connection could be made because the target machine
actively refused it',)': /simple/pip/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connec
tion broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.conne
ction.VerifiedHTTPSConnection object at 0x03654410>: Failed to establish a new c
onnection: [Errno 10061] No connection could be made because the target machine
actively refused it',)': /simple/pip/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connec
tion broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.conne
ction.VerifiedHTTPSConnection object at 0x03654150>: Failed to establish a new c
onnection: [Errno 10061] No connection could be made because the target machine
actively refused it',)': /simple/pip/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connec
tion broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.conne
ction.VerifiedHTTPSConnection object at 0x03654550>: Failed to establish a new c
onnection: [Errno 10061] No connection could be made because the target machine
actively refused it',)': /simple/pip/
  Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip

C:\Python27>

3 个答案:

答案 0 :(得分:0)

Windows msi installers collection包含所有Python版本的Python包,包括32位和64位。你需要

  1. 安装setuptools
  2. 安装pip
  3. 之后我在C:\ Python27 \ Scripts \ pip.exe找到了pip。现在您可以将其添加到路径

答案 1 :(得分:0)

您是否与互联网连接?
首先连接到Internet并再次键入此命令。如果那时这个问题也没有解决。在安装时下载python,可以选择安装pip。检查该选项是否会在您的系统中安装pip

可以选择将pip添加到您的path variable选择中。

如果您面临安装pip,请参阅此link

答案 2 :(得分:0)

我可以在断开公司使用的互联网连接后成功安装pip。它试图以某种方式拒绝连接请求。一旦我连接到当地的咖啡店热点,它就完美无缺。谢谢你的支持。 Pip安装在python 2.7.3

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\windows\system32>cd C:\Python27

C:\Python27>python get-pip.py
Collecting pip
c:\users\aja67\appdata\local\temp\tmpvssw7v\pip.zip\pip\_vendor\requests\package
s\urllib3\util\ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, b
ut the SNI (Subject Name Indication) extension to TLS is not available on this p
latform. This may cause the server to present an incorrect TLS certificate, whic
h can cause validation failures. You can upgrade to a newer version of Python to
 solve this. For more information, see https://urllib3.readthedocs.io/en/latest/
security.html#snimissingwarning.
c:\users\aja67\appdata\local\temp\tmpvssw7v\pip.zip\pip\_vendor\requests\package
s\urllib3\util\ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is
 not available. This prevents urllib3 from configuring SSL appropriately and may
 cause certain SSL connections to fail. You can upgrade to a newer version of Py
thon to solve this. For more information, see https://urllib3.readthedocs.io/en/
latest/security.html#insecureplatformwarning.
  Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
    100% |################################| 1.3MB 328kB/s
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |################################| 71kB 597kB/s
Installing collected packages: pip, wheel
Successfully installed pip-9.0.1 wheel-0.29.0
c:\users\aja67\appdata\local\temp\tmpvssw7v\pip.zip\pip\_vendor\requests\package
s\urllib3\util\ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is
 not available. This prevents urllib3 from configuring SSL appropriately and may
 cause certain SSL connections to fail. You can upgrade to a newer version of Py
thon to solve this. For more information, see https://urllib3.readthedocs.io/en/
latest/security.html#insecureplatformwarning.

C:\Python27>