hanlp segment
Traceback (most recent call last):
File "/usr/lib/python3.7/urllib/request.py", line 1324, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/usr/lib/python3.7/http/client.py", line 1260, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1306, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1255, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1030, in _send_output
self.send(msg)
File "/usr/lib/python3.7/http/client.py", line 970, in send
self.connect()
File "/usr/lib/python3.7/http/client.py", line 942, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/usr/lib/python3.7/socket.py", line 707, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/lib/python3.7/socket.py", line 748, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -5] No address associated with hostname
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/.local/bin/hanlp", line 6, in <module>
from pyhanlp.main import main
File "/home/pi/.local/lib/python3.7/site-packages/pyhanlp/__init__.py", line 149, in <module>
_start_jvm_for_hanlp()
File "/home/pi/.local/lib/python3.7/site-packages/pyhanlp/__init__.py", line 41, in _start_jvm_for_hanlp
from pyhanlp.static import STATIC_ROOT, hanlp_installed_data_version, HANLP_DATA_PATH
File "/home/pi/.local/lib/python3.7/site-packages/pyhanlp/static/__init__.py", line 285, in <module>
install_hanlp_jar()
File "/home/pi/.local/lib/python3.7/site-packages/pyhanlp/static/__init__.py", line 160, in install_hanlp_jar
jar_version, jar_url, data_version, data_url = hanlp_latest_version()
File "/home/pi/.local/lib/python3.7/site-packages/pyhanlp/static/__init__.py", line 71, in hanlp_latest_version
return hanlp_releases()[0]
File "/home/pi/.local/lib/python3.7/site-packages/pyhanlp/static/__init__.py", line 83, in hanlp_releases
content = urllib.urlopen(req).read()
File "/usr/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.7/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/usr/lib/python3.7/urllib/request.py", line 543, in _open
'_open', req)
File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/usr/lib/python3.7/urllib/request.py", line 1352, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.7/urllib/request.py", line 1326, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -5] No address associated with hostname>
这回看着正常了.好像是网络链接不通,不会需要饭强吧.苦恼了.