我刚开始使用python下的spaCy。可悲的是,我已经陷入了安装过程(https://spacy.io/docs/#getting-started)
pip install spacy
之后我想用python -m spacy.en.download
下载模型,我收到以下错误:
`Traceback (most recent call last): File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 1240, in do_open h.request(req.get_method(), req.selector, req.data, headers) File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py",
line 1083, in request self._send_request(method, url, body, headers) File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 1128, in _send_request self.endheaders(body) File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py",
line 1079, in endheaders self._send_output(message_body) File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 911, in _send_output self.send(msg) File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py",
line 854, in send self.connect() File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 1229, in connect super().connect() File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py",
line 826, in connect (self.host,self.port), self.timeout, self.source_address) File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/socket.py", line 693, in create_connection for res in getaddrinfo(host, port, 0,
SOCK_STREAM): File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/socket.py", line 732, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 8] nodename
nor servname provided, or not known During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/runpy.py", line 170,
in _run_module_as_main "__main__", mod_spec) File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.5/site-packages/spacy/en/download.py",
line 13, in
<module>
plac.call(main) File "/usr/local/lib/python3.5/site-packages/plac_core.py", line 328, in call cmd, result = parser.consume(arglist) File "/usr/local/lib/python3.5/site-packages/plac_core.py", line 207, in consume return cmd, self.func(*(args + varargs
+ extraopts), **kwargs) File "/usr/local/lib/python3.5/site-packages/spacy/en/download.py", line 9, in main download('en', force) File "/usr/local/lib/python3.5/site-packages/spacy/download.py", line 24, in download package = sputnik.install(about.__title__,
about.__version__, about.__models__[lang]) File "/usr/local/lib/python3.5/site-packages/sputnik/__init__.py", line 37, in install index.update() File "/usr/local/lib/python3.5/site-packages/sputnik/index.py", line 84, in update index = json.load(session.open(request,
'utf8')) File "/usr/local/lib/python3.5/site-packages/sputnik/session.py", line 43, in open r = self.opener.open(request) File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 465, in open
response = self._open(req, data) File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 483, in _open '_open', req) File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py",
line 443, in _call_chain result = func(*args) File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 1283, in https_open context=self._context, check_hostname=self._check_hostname) File
"/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 1242, in do_open raise URLError(err) urllib.error.URLError:
<urlopen error [Errno 8] nodename nor servname provided, or not known>
有人有类似的错误吗?
答案 0 :(得分:0)
问题是由spacy本身的服务器问题引起的,现在已修复。 (spacy.io/blog/announcement)