gpt4 book ai didi

python - Graphlab get_dependencies() SSL 证书验证失败

转载 作者:太空宇宙 更新时间:2023-11-03 14:04:58 24 4
gpt4 key购买 nike

我在让 graphlab 工作时遇到了一些问题。每次我想导入 graphlab 时,我都会收到消息:

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)

我以前在这里搜索过,但没有一个问题是相同的,或者建议的解决方案不起作用。我曾尝试在不同的地方多次重新安装 anconda 和 graphlab(我认为这可能与写入权限有关),这两次都是使用安装程序手动使用 pip。我试图手动提取文件(此处建议的解决方案:Graphlab Create setup error: graphlab.get_dependencies() results in BadZipFile error)。我还尝试更改导致 dependencies.py 错误的代码行,以便它只查找我 PC 上的文件(来自其他论坛的建议)。但无论我做什么,我都无法让它发挥作用。

据我了解,该错误似乎是由连接失败或无法设置 SSL 连接引起的。但我没有使用代理,也没有启用防火墙。

对于此问题的原因/解决方案的任何建议将不胜感激,我已经为此伤脑筋了一段时间。

最佳答案

我遇到了一个非常相似的 SSL 相关错误。 “猴子修补”ssl 模块,如 https://github.com/mtschirs/quizduellapi/issues/2 中所建议的那样,解决了那个问题。请尝试在 执行 graphlab.get_dependencies() 之前执行以下语句:

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

希望这会解锁您的 graphlab 设置。

关于python - Graphlab get_dependencies() SSL 证书验证失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43873528/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com