2017-05-09 185 views
0

我有一些問題讓graphlab工作。每次我想導入graphlab我得到的消息:Graphlab get_dependencies()SSL證書驗證失敗

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 

這個消息後,我做的事:graphlab.get_dependencies(),並得到以下信息:

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) 

之前,我已經在這裏搜查,但沒有任何問題是相同的或者建議的解決方案不起作用。我試圖重新安裝conda和graphlab幾次在不同的地方(我想也許它與寫權限有關)與安裝程序手動使用點。我試圖手動提取文件(這裏建議的解決方案:Graphlab Create setup error: graphlab.get_dependencies() results in BadZipFile error)。我還嘗試更改導致dependencies.py中的錯誤的代碼行,以便在我的PC上查找這些文件(來自其他論壇的建議)。但無論我做什麼,我都無法讓它工作。

從我的理解,它看起來像錯誤是由連接失敗或因爲它無法建立SSL連接。但我沒有使用代理並且沒有啓用防火牆。

任何對這個問題的原因/解決方案的建議將不勝感激,我已經傷了我一段時間了。

回答

1

我遇到了一個非常類似於SSL的錯誤。按照https://github.com/mtschirs/quizduellapi/issues/2中的建議,「修補」ssl模塊解決了該問題。請嘗試執行graphlab.get_dependencies()之前執行以下語句

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

希望這會放開你的graphlab設置。

+0

和問題一樣的問題,解決了這個問題 – Alan

相關問題