Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python -m unidic download error #184

Open
0Rambler0 opened this issue Apr 26, 2024 · 1 comment
Open

python -m unidic download error #184

0Rambler0 opened this issue Apr 26, 2024 · 1 comment

Comments

@0Rambler0
Copy link

python -m unidic download
This command return a error urllib.error.URLError: <urlopen error [Errno 104] Connection reset by peer>

@aohanhongzhi
Copy link

aohanhongzhi commented Apr 27, 2024

maybe you should check the internet connection for your computer

image

download url: https://cotonoha-dic.s3-ap-northeast-1.amazonaws.com/unidic-3.1.0.zip

I set up proxy but the error happened

eric@eric-Vivobook-ASUSLaptop-M7600QE-M7600QE:~$ export HTTPS_PROXY=socks5://127.0.0.1:20170
eric@eric-Vivobook-ASUSLaptop-M7600QE-M7600QE:~$ python -m unidic download
download url: https://cotonoha-dic.s3-ap-northeast-1.amazonaws.com/unidic-3.1.0.zip
Dictionary version: 3.1.0+2021-08-31
Downloading UniDic v3.1.0+2021-08-31...
unidic-3.1.0.zip: 0.00B [00:00, ?B/s]
Traceback (most recent call last):
  File "/usr/lib/python3.10/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.10/http/client.py", line 1283, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1329, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1278, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1038, in _send_output
    self.send(msg)
  File "/usr/lib/python3.10/http/client.py", line 976, in send
    self.connect()
  File "/usr/lib/python3.10/http/client.py", line 1448, in connect
    super().connect()
  File "/usr/lib/python3.10/http/client.py", line 952, in connect
    self._tunnel()
  File "/usr/lib/python3.10/http/client.py", line 921, in _tunnel
    (version, code, message) = response._read_status()
  File "/usr/lib/python3.10/http/client.py", line 287, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/eric/.local/lib/python3.10/site-packages/unidic/__main__.py", line 17, in <module>
    plac.call(commands[command], sys.argv[1:])
  File "/home/eric/.local/lib/python3.10/site-packages/plac_core.py", line 436, in call
    cmd, result = parser.consume(arglist)
  File "/home/eric/.local/lib/python3.10/site-packages/plac_core.py", line 287, in consume
    return cmd, self.func(*(args + varargs + extraopts), **kwargs)
  File "/home/eric/.local/lib/python3.10/site-packages/unidic/download.py", line 104, in download_version
    download_and_clean(dictinfo['version'], dictinfo['url'])
  File "/home/eric/.local/lib/python3.10/site-packages/unidic/download.py", line 62, in download_and_clean
    download_progress(url, fname)
  File "/home/eric/.local/lib/python3.10/site-packages/unidic/download.py", line 38, in download_progress
    urlretrieve(url, filename=fname, reporthook=t.update_to, data=None)
  File "/usr/lib/python3.10/urllib/request.py", line 241, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/usr/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/usr/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/lib/python3.10/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error Remote end closed connection without response>

I just download the file ,but I dont know where should i place it ?

image

update the code below

image

and run it again

image

it works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants