Q:

Runtime error when trying to use pip

I have managed to royally screw myself over by doing something which seemed innocuous.
i was getting the following error from my python script (brand['feed'] = the URL i'm making the request to):
**C:\Python27\lib\site-packages\requests\packages\urllib3\util\ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

  InsecurePlatformWarning

Traceback (most recent call last):

  File "D:\Phocas\Phocas-Automation\analytics\download_feed_cats.py", line 18, in <module>

    data = requests.get(brand['feed'])

  File "C:\Python27\lib\site-packages\requests\api.py", line 69, in get

    return request('get', url, params=params, **kwargs)

  File "C:\Python27\lib\site-packages\requests\api.py", line 50, in request

    response = session.request(method=method, url=url, **kwargs)

  File "C:\Python27\lib\site-packages\requests\sessions.py", line 465, in request

    resp = self.send(prep, **send_kwargs)

  File "C:\Python27\lib\site-packages\requests\sessions.py", line 594, in send

    history = [resp for resp in gen] if allow_redirects else []

  File "C:\Python27\lib\site-packages\requests\sessions.py", line 196, in resolve_redirects

    **adapter_kwargs

  File "C:\Python27\lib\site-packages\requests\sessions.py", line 573, in send

    r = adapter.send(request, **kwargs)

  File "C:\Python27\lib\site-packages\requests\adapters.py", line 431, in send

    raise SSLError(e, request=request)

requests.exceptions.SSLError: [Errno 1] _ssl.c:507: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed**

So i asked the internet and the internet said do this:
pip install --upgrade ndg-httpsclient

So i did that and now i keep getting a RuntimeError when i run the same script, what's crazy is even if i just try and run pip in the shell, i get the same error!!
Phocas_Tommy@p3303386 MINGW64 /c/Python27
$ pip

Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\pip.exe\__main__.py", line 5, in <module>
  File "C:\Python27\lib\site-packages\pip\__init__.py", line 11, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "C:\Python27\lib\site-packages\pip\vcs\mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "C:\Python27\lib\site-packages\pip\download.py", line 22, in <module>
    from pip._vendor import requests, six
  File "C:\Python27\lib\site-packages\pip\_vendor\requests\__init__.py", line 53, in <module>
    from .packages.urllib3.contrib import pyopenssl
  File "C:\Python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\contrib\pyopenssl.py", line 43, in <module>
    import OpenSSL.SSL
  File "C:\Python27\lib\site-packages\OpenSSL\__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "C:\Python27\lib\site-packages\OpenSSL\rand.py", line 12, in <module>
    from OpenSSL._util import (
  File "C:\Python27\lib\site-packages\OpenSSL\_util.py", line 9, in <module>
    binding = Binding()
  File "C:\Python27\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 114, in __init__
    self._ensure_ffi_initialized()
  File "C:\Python27\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 126, in _ensure_ffi_initialized
    cls._modules,
  File "C:\Python27\lib\site-packages\cryptography\hazmat\bindings\utils.py", line 31, in load_library_for_binding
    lib = ffi.verifier.load_library()
  File "C:\Python27\lib\site-packages\cffi\verifier.py", line 96, in load_library
    self._compile_module()
  File "C:\Python27\lib\site-packages\cryptography\hazmat\bindings\utils.py", line 127, in _compile_module
    "Attempted implicit compile of a cffi module. All cffi modules should "
RuntimeError: Attempted implicit compile of a cffi module. All cffi modules should be pre-compiled at installation time.

I have searched this error and can't seem to find anything which helps. I'm using python 2.7.6 on Windows Server 2008 R2 Standard 64-bit

A:

Re-installing Python fixed this problem

