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

无法使用 #149

Closed
wangdp9918 opened this issue Nov 28, 2024 · 1 comment
Closed

无法使用 #149

wangdp9918 opened this issue Nov 28, 2024 · 1 comment

Comments

@wangdp9918
Copy link

在安装了pip install pdf2zh之后,输入pdf2zh document.pdf,出现urllib3.exceptions.ProxyError: ('Unable to connect to proxy', FileNotFoundError(2, 'No such file or directory'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "d:\soft\python3.8\lib\site-packages\requests\adapters.py", line 667, in send
resp = conn.urlopen(
File "d:\soft\python3.8\lib\site-packages\urllib3\connectionpool.py", line 843, in urlopen
retries = retries.increment(
File "d:\soft\python3.8\lib\site-packages\urllib3\util\retry.py", line 519, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /juliozhao/DocLayout-YOLO-DocStructBench/resolve/main/doclayout_yolo_docstructbench_imgsz1024.pt (Caused by ProxyError('Unable to connect to proxy', FileNotFoundError(2, 'No such file or directory')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "d:\soft\python3.8\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "d:\soft\python3.8\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "D:\soft\python3.8\Scripts\pdf2zh.exe_main
.py", line 7, in
sys.exit(main())
File "d:\soft\python3.8\lib\site-packages\pdf2zh\pdf2zh.py", line 274, in main
extract_text(**vars(parsed_args))
File "d:\soft\python3.8\lib\site-packages\pdf2zh\pdf2zh.py", line 89, in extract_text
pth = hf_hub_download(
File "d:\soft\python3.8\lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "d:\soft\python3.8\lib\site-packages\huggingface_hub\file_download.py", line 862, in hf_hub_download
return _hf_hub_download_to_cache_dir(
File "d:\soft\python3.8\lib\site-packages\huggingface_hub\file_download.py", line 925, in _hf_hub_download_to_cache_dir
(url_to_download, etag, commit_hash, expected_size, head_call_error) = _get_metadata_or_catch_error(
File "d:\soft\python3.8\lib\site-packages\huggingface_hub\file_download.py", line 1376, in _get_metadata_or_catch_error
metadata = get_hf_file_metadata(
File "d:\soft\python3.8\lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "d:\soft\python3.8\lib\site-packages\huggingface_hub\file_download.py", line 1296, in get_hf_file_metadata
r = _request_wrapper(
File "d:\soft\python3.8\lib\site-packages\huggingface_hub\file_download.py", line 277, in _request_wrapper
response = _request_wrapper(
File "d:\soft\python3.8\lib\site-packages\huggingface_hub\file_download.py", line 300, in _request_wrapper
response = get_session().request(method=method, url=url, **params)
File "d:\soft\python3.8\lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "d:\soft\python3.8\lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "d:\soft\python3.8\lib\site-packages\huggingface_hub\utils_http.py", line 93, in send
return super().send(request, *args, **kwargs)
File "d:\soft\python3.8\lib\site-packages\requests\adapters.py", line 694, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /juliozhao/DocLayout-YOLO-DocStructBench/resolve/main/doclayout_yolo_docstructbench_imgsz1024.pt (Caused by ProxyError('Unable to connect to proxy', FileNotFoundError(2, 'No such file or directory')))"), '(Request ID: fe89d648-5b2f-47f6-bd37-fec72b5b0988)')
在询问gpt后,解释为
“代理连接问题:你的程序试图通过一个代理连接到外部服务器(在这个例子中是 Hugging Face 的服务器),但是由于某些原因,程序无法通过代理成功连接。可能的原因包括代理服务器不可用,代理配置不正确,或者代理的文件路径丢失等。

文件找不到错误:FileNotFoundError表示程序在尝试访问文件时找不到文件或目录。这通常是由于配置错误或者文件路径不正确引起的。

请求重试失败:在尝试连接 Hugging Face 服务器的过程中,程序多次重试但都未能成功,导致最终抛出了 MaxRetryError 错误。”
请问应该如何操作。
这是我的第二个电脑上出现的问题,第一个电脑上可以正常使用,都可以科学上网
万望回复为盼

@Byaidu
Copy link
Owner

Byaidu commented Nov 28, 2024

#134

@Byaidu Byaidu closed this as completed Nov 28, 2024
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