在python 2.7.6中安装pip时出错

时间:2015-02-12 09:11:04

标签: python-2.7 pip

尝试通过下载get-pip.py并运行python get-pip.py来在Windows 7中的python 2.7.6中安装pip。但是获取超时错误

Collecting pip
      Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connec
    tion broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.conne
    ction.VerifiedHTTPSConnection object at 0x034F5DB0>, 'Connection to pypi.python.
    org timed out. (connect timeout=15)')': /simple/pip/
      Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connec
    tion broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.conne
    ction.VerifiedHTTPSConnection object at 0x034F5E50>, 'Connection to pypi.python.
    org timed out. (connect timeout=15)')': /simple/pip/
      Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connec
    tion broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.conne
    ction.VerifiedHTTPSConnection object at 0x034F5F30>, 'Connection to pypi.python.
    org timed out. (connect timeout=15)')': /simple/pip/
      Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connec
    tion broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.conne
    ction.VerifiedHTTPSConnection object at 0x034F5FD0>, 'Connection to pypi.python.
    org timed out. (connect timeout=15)')': /simple/pip/
      Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connec
    tion broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.conne
    ction.VerifiedHTTPSConnection object at 0x034F5970>, 'Connection to pypi.python.
    org timed out. (connect timeout=15)')': /simple/pip/

2 个答案:

答案 0 :(得分:-1)

问题是,它检查网络是否有更新版本。您可以使用--disable-pip-version-check禁用它,然后它不应该使用重试机制。

使用:

PIP_DISABLE_PIP_VERSION_CHECK=1

它应该有用。

答案 1 :(得分:-1)

请按照以下步骤操作:

  1. 查找pyvisa下载它。
  2. 将其粘贴到python interpreter文件夹中,并将其放在脚本文件夹中。
  3. 按住shift键并右键单击,从脚本文件夹打开命令提示符。
  4. 打开命令提示符后,键入pip install pyp并按Tab键将显示路径。
  5. 最后输入执行。