Lolo
Lolo

Reputation: 1

Graphlab get_dependencies() SSL certificate verify failed

I am having some problems to get graphlab to work. Every time I want to import graphlab I get the message:

ACTION REQUIRED: Dependencies libstdc++-6.dll and libgcc_s_seh-1.dll not found.

1. Ensure user account has write permission to C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\site-packages\graphlab
2. Run graphlab.get_dependencies() to download and install them.
3. Restart Python and import graphlab again.

By running the above function, you agree to the following licenses.

* libstdc++: https://gcc.gnu.org/onlinedocs/libstdc++/manual/license.html
* xz: http://git.tukaani.org/?p=xz.git;a=blob;f=COPYING

After this message I do: graphlab.get_dependencies() and get the following message:

Downloading xz.

---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-2-9e64085fb919> in <module>()
----> 1 graphlab.get_dependencies()

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\site-packages\graphlab\dependencies.pyc in get_dependencies()
     31 
     32     print('Downloading xz.')
---> 33     (xzarchive_file, xzheaders) = urllib.urlretrieve('http://tukaani.org/xz/xz-5.2.1-windows.zip')
     34     xzarchive_dir = tempfile.mkdtemp()
     35     print('Extracting xz.')

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\urllib.pyc in urlretrieve(url, filename, reporthook, data, context)
     96     else:
     97         opener = _urlopener
---> 98     return opener.retrieve(url, filename, reporthook, data)
     99 def urlcleanup():
    100     if _urlopener:

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\urllib.pyc in retrieve(self, url, filename, reporthook, data)
    243             except IOError:
    244                 pass
--> 245         fp = self.open(url, data)
    246         try:
    247             headers = fp.info()

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\urllib.pyc in open(self, fullurl, data)
    211         try:
    212             if data is None:
--> 213                 return getattr(self, name)(url)
    214             else:
    215                 return getattr(self, name)(url, data)

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\urllib.pyc in open_http(self, url, data)
    362         else:
    363             if data is None:
--> 364                 return self.http_error(url, fp, errcode, errmsg, headers)
    365             else:
    366                 return self.http_error(url, fp, errcode, errmsg, headers, data)

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\urllib.pyc in http_error(self, url, fp, errcode, errmsg, headers, data)
    375             method = getattr(self, name)
    376             if data is None:
--> 377                 result = method(url, fp, errcode, errmsg, headers)
    378             else:
    379                 result = method(url, fp, errcode, errmsg, headers, data)

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\urllib.pyc in http_error_301(self, url, fp, errcode, errmsg, headers, data)
    669     def http_error_301(self, url, fp, errcode, errmsg, headers, data=None):
    670         """Error 301 -- also relocated (permanently)."""
--> 671         return self.http_error_302(url, fp, errcode, errmsg, headers, data)
    672 
    673     def http_error_303(self, url, fp, errcode, errmsg, headers, data=None):

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\urllib.pyc in http_error_302(self, url, fp, errcode, errmsg, headers, data)
    639                         "Internal Server Error: Redirect Recursion", headers)
    640         result = self.redirect_internal(url, fp, errcode, errmsg, headers,
--> 641                                         data)
    642         self.tries = 0
    643         return result

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\urllib.pyc in redirect_internal(self, url, fp, errcode, errmsg, headers, data)
    665                           headers)
    666 
--> 667         return self.open(newurl)
    668 
    669     def http_error_301(self, url, fp, errcode, errmsg, headers, data=None):

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\urllib.pyc in open(self, fullurl, data)
    211         try:
    212             if data is None:
--> 213                 return getattr(self, name)(url)
    214             else:
    215                 return getattr(self, name)(url, data)

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\urllib.pyc in open_https(self, url, data)
    441             if realhost: h.putheader('Host', realhost)
    442             for args in self.addheaders: h.putheader(*args)
--> 443             h.endheaders(data)
    444             errcode, errmsg, headers = h.getreply()
    445             fp = h.getfile()

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\httplib.pyc in endheaders(self, message_body)
   1051         else:
   1052             raise CannotSendHeader()
-> 1053         self._send_output(message_body)
   1054 
   1055     def request(self, method, url, body=None, headers={}):

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\httplib.pyc in _send_output(self, message_body)
    895             msg += message_body
    896             message_body = None
--> 897         self.send(msg)
    898         if message_body is not None:
    899             #message_body was not a string (i.e. it is a file) and

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\httplib.pyc in send(self, data)
    857         if self.sock is None:
    858             if self.auto_open:
--> 859                 self.connect()
    860             else:
    861                 raise NotConnected()

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\httplib.pyc in connect(self)
   1276 
   1277             self.sock = self._context.wrap_socket(self.sock,
-> 1278                                                   server_hostname=server_hostname)
   1279 
   1280     __all__.append("HTTPSConnection")

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\ssl.pyc in wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname)
    350                          suppress_ragged_eofs=suppress_ragged_eofs,
    351                          server_hostname=server_hostname,
--> 352                          _context=self)
    353 
    354     def set_npn_protocols(self, npn_protocols):

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\ssl.pyc in __init__(self, sock, keyfile, certfile, server_side, cert_reqs, ssl_version, ca_certs, do_handshake_on_connect, family, type, proto, fileno, suppress_ragged_eofs, npn_protocols, ciphers, server_hostname, _context)
    577                         # non-blocking
    578                         raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets")
--> 579                     self.do_handshake()
    580 
    581             except (OSError, ValueError):

C:\Users\Lorenzpc\Desktop\cousera\anaconda installation\Anaconda2\envs\gl-env\lib\ssl.pyc in do_handshake(self, block)
    806             if timeout == 0.0 and block:
    807                 self.settimeout(None)
--> 808             self._sslobj.do_handshake()
    809         finally:
    810             self.settimeout(timeout)

IOError: [Errno socket error] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)

I have searched here before, but none of the problems were the same or the suggested solutions didn't work. I have tried to reinstall anconda and graphlab several times in different place (I thought maybe it had something to do with the write permissions) both with the installer an manually using pip. I have tried to manually extract the files (a solution suggested here: Graphlab Create setup error: graphlab.get_dependencies() results in BadZipFile error). I also tried to change the line of code that causes the fault in dependencies.py so it would just look for the files on my PC (suggestion from an other forum). But no matter what I do I can't get it to work.

From what I understand, it looks like the error is caused by a failed connection or because it was unable to set up an SSL connection. But I am not using a proxy and have no firewall enabled.

Any suggestions to the cause/solution to this problem would be greatly appreciated, I have been hurting my head over this for a while.

Upvotes: 0

Views: 398

Answers (1)

so2
so2

Reputation: 322

I encountered a very similar SSL-related error. "Monkey-patching" the ssl module, as suggested in https://github.com/mtschirs/quizduellapi/issues/2, solved that problem. Please try executing the following statements before executing graphlab.get_dependencies():

import ssl
if hasattr(ssl, '_create_unverified_context'):
    ssl._create_default_https_context = ssl._create_unverified_context

Hope this unblocks your graphlab set-up.

Upvotes: 1

Related Questions