gpt4 book ai didi

python - 我在尝试安装 spaCy 英语语言模型时收到 CERTIFICATE_VERIFY_FAILED

转载 作者:太空狗 更新时间:2023-10-29 20:15:21 26 4
gpt4 key购买 nike

我通过 Anaconda 在 Python 3.5.2 上运行 OS X El Capitan,并且有 spaCy 0.101.0。

我正在尝试使用 python -m spacy.en.download 安装 spaCy 英语语言模型.但是,当我这样做时,我收到一条错误消息 urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)> .完整的Traceback如下:

Traceback (most recent call last):
File "/Users/bsherman/anaconda/lib/python3.5/urllib/request.py", line 1254, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/Users/bsherman/anaconda/lib/python3.5/http/client.py", line 1106, in request
self._send_request(method, url, body, headers)
File "/Users/bsherman/anaconda/lib/python3.5/http/client.py", line 1151, in _send_request
self.endheaders(body)
File "/Users/bsherman/anaconda/lib/python3.5/http/client.py", line 1102, in endheaders
self._send_output(message_body)
File "/Users/bsherman/anaconda/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/Users/bsherman/anaconda/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/Users/bsherman/anaconda/lib/python3.5/http/client.py", line 1260, in connect
server_hostname=server_hostname)
File "/Users/bsherman/anaconda/lib/python3.5/ssl.py", line 377, in wrap_socket
_context=self)
File "/Users/bsherman/anaconda/lib/python3.5/ssl.py", line 752, in __init__
self.do_handshake()
File "/Users/bsherman/anaconda/lib/python3.5/ssl.py", line 988, in do_handshake
self._sslobj.do_handshake()
File "/Users/bsherman/anaconda/lib/python3.5/ssl.py", line 633, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/bsherman/anaconda/lib/python3.5/runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "/Users/bsherman/anaconda/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/bsherman/anaconda/lib/python3.5/site-packages/spacy/en/download.py", line 13, in <module>
plac.call(main)
File "/Users/bsherman/anaconda/lib/python3.5/site-packages/plac_core.py", line 328, in call
cmd, result = parser.consume(arglist)
File "/Users/bsherman/anaconda/lib/python3.5/site-packages/plac_core.py", line 207, in consume
return cmd, self.func(*(args + varargs + extraopts), **kwargs)
File "/Users/bsherman/anaconda/lib/python3.5/site-packages/spacy/en/download.py", line 9, in main
download('en', force)
File "/Users/bsherman/anaconda/lib/python3.5/site-packages/spacy/download.py", line 24, in download
package = sputnik.install(about.__title__, about.__version__, about.__models__[lang])
File "/Users/bsherman/anaconda/lib/python3.5/site-packages/sputnik/__init__.py", line 37, in install
index.update()
File "/Users/bsherman/anaconda/lib/python3.5/site-packages/sputnik/index.py", line 84, in update
index = json.load(session.open(request, 'utf8'))
File "/Users/bsherman/anaconda/lib/python3.5/site-packages/sputnik/session.py", line 43, in open
r = self.opener.open(request)
File "/Users/bsherman/anaconda/lib/python3.5/urllib/request.py", line 466, in open
response = self._open(req, data)
File "/Users/bsherman/anaconda/lib/python3.5/urllib/request.py", line 484, in _open
'_open', req)
File "/Users/bsherman/anaconda/lib/python3.5/urllib/request.py", line 444, in _call_chain
result = func(*args)
File "/Users/bsherman/anaconda/lib/python3.5/urllib/request.py", line 1297, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/Users/bsherman/anaconda/lib/python3.5/urllib/request.py", line 1256, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)>

最佳答案

在终端中运行:

/Applications/Python 3.5.2/Install Certificates.command

或通过pip更新certifi

关于python - 我在尝试安装 spaCy 英语语言模型时收到 CERTIFICATE_VERIFY_FAILED,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38835270/

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