docling-project / docling-project/docling

Getting [SSL: CERTIFICATE_VERIFY_FAILED] error when attempting to download model using basic example.

Open
#2,104 2 comments 0 reactions 0 assignees View on GitHub
bug triage/close-stale
Dominant language
Python
Stars
66.4k
Forks
4.8k
Avg merge
2d 21h
Merged PRs (30d)
84

Description

### Bug
Hello all, getting this error when running the basic example

```(.venv) x@x-MacBook-Pro PyCharmMiscProject % python script1.py
Downloading detection model, please wait. This may take several minutes depending upon your network connection.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1348, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1303, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1349, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1298, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1058, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 996, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1475, in connect
self.sock = self._context.wrap_socket(self.sock,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 517, in wrap_socket
return self.sslsocket_class._create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 1104, in _create
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 1382, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/x/PyCharmMiscProject/script1.py", line 5, in
result = converter.convert(source)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/x/PyCharmMiscProject/.venv/lib/python3.11/site-packages/pydantic/_internal/_validate_call.py", line 39, in wrapper_function
return wrapper(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/x/PyCharmMiscProject/.venv/lib/python3.11/site-packages/pydantic/_internal/_validate_call.py", line 136, in __call__
res = self.__pydantic_validator__.validate_python(pydantic_core.ArgsKwargs(args, kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/x/PyCharmMiscProject/.venv/lib/python3.11/site-packages/docling/document_converter.py", line 244, in convert
return next(all_res)
^^^^^^^^^^^^^
File "/Users/x/PyCharmMiscProject/.venv/lib/python3.11/site-packages/docling/document_converter.py", line 267, in convert_all
for conv_res in conv_res_iter:
File "/Users/x/PyCharmMiscProject/.venv/lib/python3.11/site-packages/docling/document_converter.py", line 339, in _convert
for item in map(
File "/Users/x/PyCharmMiscProject/.venv/lib/python3.11/site-packages/docling/document_converter.py", line 386, in _process_document
conv_res = self._execute_pipeline(in_doc, raises_on_error=raises_on_error)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/x/PyCharmMiscProject/.venv/lib/python3.11/site-packages/docling/document_converter.py", line 407, in _execute_pipeline
pipeline = self._get_pipeline(in_doc.format)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/x/PyCharmMiscProject/.venv/lib/python3.11/site-packages/docling/document_converter.py", line 369, in _get_pipeline
self.initialized_pipelines[cache_key] = pipeline_class(
^^^^^^^^^^^^^^^
File "/Users/x/PyCharmMiscProject/.venv/lib/python3.11/site-packages/docling/pipeline/standard_pdf_pipeline.py", line 66, in __init__
ocr_model = self.get_ocr_model(artifacts_path=artifacts_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/x/PyCharmMiscProject/.venv/lib/python3.11/site-packages/docling/pipeline/standard_pdf_pipeline.py", line 154, in get_ocr_model
return factory.create_instance(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/x/PyCharmMiscProject/.venv/lib/python3.11/site-packages/docling/models/factories/base_factory.py", line 57, in create_instance
return _cls(options=options, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/x/PyCharmMiscProject/.venv/lib/python3.11/site-packages/docling/models/easyocr_model.py", line 81, in __init__
self.reader = easyocr.Reader(
^^^^^^^^^^^^^^^
File "/Users/x/PyCharmMiscProject/.venv/lib/python3.11/site-packages/easyocr/easyocr.py", line 92, in __init__
detector_path = self.getDetectorPath(detect_network)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/x/PyCharmMiscProject/.venv/lib/python3.11/site-packages/easyocr/easyocr.py", line 253, in getDetectorPath
download_and_unzip(self.detection_models[self.detect_network]['url'], self.detection_models[self.detect_network]['filename'], self.model_storage_directory, self.verbose)
File "/Users/x/PyCharmMiscProject/.venv/lib/python3.11/site-packages/easyocr/utils.py", line 628, in download_and_unzip
urlretrieve(url, zip_path, reporthook=reporthook)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 241, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 216, in urlopen
return opener.open(url, data, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 519, in open
response = self._open(req, data)
^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 536, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 496, in _call_chain
result = func(*args)
^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1391, in https_open
return self.do_open(http.client.HTTPSConnection, req,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1351, in do_open
raise URLError(err)
urllib.error.URLError: ```
...

### Steps to reproduce
Run this code:

```
from docling.document_converter import DocumentConverter

source = "TIS 07 2025.pdf" # document per local path or URL
converter = DocumentConverter()
result = converter.convert(source)
print(result.document.export_to_markdown()) # output: "## Docling Technical Report[...]"
```
...

### Docling version
```
Docling version: 2.45.0
Docling Core version: 2.44.2
Docling IBM Models version: 3.9.0
Docling Parse version: 4.2.1
Python: cpython-311 (3.11.9)
Platform: macOS-15.5-arm64-arm-64bit
```
...

### Python version
3.11.9
...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.