Byaidu / PDFMathTranslate

PDF scientific paper translation and bilingual comparison - 完整保留排版的 PDF 文档全文双语翻译,支持 Google/DeepL/Ollama/OpenAI 翻译
GNU Affero General Public License v3.0
1.47k stars 115 forks source link

运行时报错 #55

Open night-cruise opened 2 days ago

night-cruise commented 2 days ago

问题描述

Matplotlib is building the font cache; this may take a moment.
Downloading...
Traceback (most recent call last):
  File "C:\D\app\python\Lib\urllib\request.py", line 1344, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "C:\D\app\python\Lib\http\client.py", line 1327, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\D\app\python\Lib\http\client.py", line 1373, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "C:\D\app\python\Lib\http\client.py", line 1322, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\D\app\python\Lib\http\client.py", line 1081, in _send_output
    self.send(msg)
  File "C:\D\app\python\Lib\http\client.py", line 1025, in send
    self.connect()
  File "C:\D\app\python\Lib\http\client.py", line 1468, in connect
    self.sock = self._context.wrap_socket(self.sock,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\D\app\python\Lib\ssl.py", line 455, in wrap_socket
    return self.sslsocket_class._create(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\D\app\python\Lib\ssl.py", line 1046, in _create
    self.do_handshake()
  File "C:\D\app\python\Lib\ssl.py", line 1321, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\D\app\python\Scripts\pdf2zh.exe\__main__.py", line 7, in <module>
  File "C:\D\app\python\Lib\site-packages\pdf2zh\pdf2zh.py", line 229, in main
    extract_text(**vars(parsed_args))
  File "C:\D\app\python\Lib\site-packages\pdf2zh\pdf2zh.py", line 73, in extract_text
    urllib.request.urlretrieve("http://huggingface.co/juliozhao/DocLayout-YOLO-DocStructBench/resolve/main/doclayout_yolo_docstructbench_imgsz1024.pt",pth)
  File "C:\D\app\python\Lib\urllib\request.py", line 240, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
                            ^^^^^^^^^^^^^^^^^^
  File "C:\D\app\python\Lib\urllib\request.py", line 215, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\D\app\python\Lib\urllib\request.py", line 521, in open
    response = meth(req, response)
               ^^^^^^^^^^^^^^^^^^^
  File "C:\D\app\python\Lib\urllib\request.py", line 630, in http_response
    response = self.parent.error(
               ^^^^^^^^^^^^^^^^^^
  File "C:\D\app\python\Lib\urllib\request.py", line 553, in error
    result = self._call_chain(*args)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\D\app\python\Lib\urllib\request.py", line 492, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "C:\D\app\python\Lib\urllib\request.py", line 745, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\D\app\python\Lib\urllib\request.py", line 521, in open
    response = meth(req, response)
               ^^^^^^^^^^^^^^^^^^^
  File "C:\D\app\python\Lib\urllib\request.py", line 630, in http_response
    response = self.parent.error(
               ^^^^^^^^^^^^^^^^^^
  File "C:\D\app\python\Lib\urllib\request.py", line 553, in error
    result = self._call_chain(*args)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\D\app\python\Lib\urllib\request.py", line 492, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "C:\D\app\python\Lib\urllib\request.py", line 745, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\D\app\python\Lib\urllib\request.py", line 515, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
  File "C:\D\app\python\Lib\urllib\request.py", line 532, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\D\app\python\Lib\urllib\request.py", line 492, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "C:\D\app\python\Lib\urllib\request.py", line 1392, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\D\app\python\Lib\urllib\request.py", line 1347, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>
wl199601 commented 2 days ago

一样遇到了

Byaidu commented 2 days ago

参考 https://github.com/Byaidu/PDFMathTranslate/issues/32

karllao commented 1 day ago

同样遇到了,确认网络正常,全局代理也是无法使用的

tangqingmiao commented 1 day ago

Traceback (most recent call last): File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 1348, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\http\client.py", line 1294, in request self._send_request(method, url, body, headers, encode_chunked) File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\http\client.py", line 1340, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\http\client.py", line 1289, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\http\client.py", line 1048, in _send_output self.send(msg) File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\http\client.py", line 986, in send self.connect() File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\http\client.py", line 1466, in connect self.sock = self._context.wrap_socket(self.sock, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 517, in wrap_socket return self.sslsocket_class._create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 1108, in _create self.do_handshake() File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 1383, in do_handshake self._sslobj.do_handshake() ssl.SSLEOFError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Scripts\pdf2zh.exe__main__.py", line 7, in File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\site-packages\pdf2zh\pdf2zh.py", line 229, in main extract_text(*vars(parsed_args)) File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\site-packages\pdf2zh\pdf2zh.py", line 73, in extract_text urllib.request.urlretrieve("http://huggingface.co/juliozhao/DocLayout-YOLO-DocStructBench/resolve/main/doclayout_yolo_docstructbench_imgsz1024.pt",pth) File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 241, in urlretrieve with contextlib.closing(urlopen(url, data)) as fp: ^^^^^^^^^^^^^^^^^^ File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 216, in urlopen return opener.open(url, data, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 525, in open response = meth(req, response) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 634, in http_response response = self.parent.error( ^^^^^^^^^^^^^^^^^^ File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 557, in error result = self._call_chain(args) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 496, in _call_chain result = func(args) ^^^^^^^^^^^ File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 749, in http_error_302 return self.parent.open(new, timeout=req.timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 519, in open response = self._open(req, data) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 536, in _open result = self._call_chain(self.handle_open, protocol, protocol + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 496, in _call_chain result = func(args) ^^^^^^^^^^^ File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 1391, in https_open return self.do_open(http.client.HTTPSConnection, req, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\24525\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 1351, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)>

tangqingmiao commented 1 day ago

遇到了这个问题

tangqingmiao commented 1 day ago

怎么解决的????

Zhu-Zhengqin commented 20 hours ago

同样……

night-cruise commented 17 hours ago

参考 #32

已经设置了代理,没有用。我用其他的需要连外网的命令行应用是可以正常连接的。

Byaidu commented 13 hours ago

好像少数用户的 ssl 有问题 https://github.com/Byaidu/PDFMathTranslate/issues/12 ,我看看怎么解决