ArneBinder / pie-datasets

Building scripts for Pytorch-IE datasets.
MIT License
1 stars 0 forks source link

test_aae2 may fail with "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed" on macOS #133

Closed kai-car closed 4 months ago

kai-car commented 4 months ago

test_aae2 may failed on my system (macOS) with the following error

urllib.error.URLError: ``` Overwriting format type 'document' (DocumentFormatter -> DocumentFormatter) Overwriting format type alias 'document' (document -> document) tests/dataset_builders/pie/aae2/test_aae2.py:None (tests/dataset_builders/pie/aae2/test_aae2.py)/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py:1348: in do_open h.request(req.get_method(), req.selector, req.data, headers, /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py:1282: in request self._send_request(method, url, body, headers, encode_chunked) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py:1328: in _send_request self.endheaders(body, encode_chunked=encode_chunked) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py:975: in send self.connect() /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py:1454: in connect self.sock = self._context.wrap_socket(self.sock, /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py:512: in wrap_socket return self.sslsocket_class._create( /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py:1070: in _create self.do_handshake() /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py:1341: in do_handshake self._sslobj.do_handshake() E ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997) During handling of the above exception, another exception occurred: tests/dataset_builders/pie/aae2/test_aae2.py:14: in from dataset_builders.pie.aae2.aae2 import ( dataset_builders/pie/aae2/aae2.py:29: in SPLIT_PATHS = get_split_paths(URL_SPLIT_IDS, subdirectory="brat-project-final") dataset_builders/pie/aae2/aae2.py:19: in get_split_paths df_splits = pd.read_csv(url_split_ids, sep=";") ../../../Library/Caches/pypoetry/virtualenvs/pie-datasets-HpQTGuq4-py3.10/lib/python3.10/site-packages/pandas/io/parsers/readers.py:1026: in read_csv return _read(filepath_or_buffer, kwds) ../../../Library/Caches/pypoetry/virtualenvs/pie-datasets-HpQTGuq4-py3.10/lib/python3.10/site-packages/pandas/io/parsers/readers.py:620: in _read parser = TextFileReader(filepath_or_buffer, **kwds) ../../../Library/Caches/pypoetry/virtualenvs/pie-datasets-HpQTGuq4-py3.10/lib/python3.10/site-packages/pandas/io/parsers/readers.py:1620: in __init__ self._engine = self._make_engine(f, self.engine) ../../../Library/Caches/pypoetry/virtualenvs/pie-datasets-HpQTGuq4-py3.10/lib/python3.10/site-packages/pandas/io/parsers/readers.py:1880: in _make_engine self.handles = get_handle( ../../../Library/Caches/pypoetry/virtualenvs/pie-datasets-HpQTGuq4-py3.10/lib/python3.10/site-packages/pandas/io/common.py:728: in get_handle ioargs = _get_filepath_or_buffer( ../../../Library/Caches/pypoetry/virtualenvs/pie-datasets-HpQTGuq4-py3.10/lib/python3.10/site-packages/pandas/io/common.py:384: in _get_filepath_or_buffer with urlopen(req_info) as req: ../../../Library/Caches/pypoetry/virtualenvs/pie-datasets-HpQTGuq4-py3.10/lib/python3.10/site-packages/pandas/io/common.py:289: in urlopen return urllib.request.urlopen(*args, **kwargs) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py:216: in urlopen return opener.open(url, data, timeout) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py:519: in open response = self._open(req, data) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py:536: in _open result = self._call_chain(self.handle_open, protocol, protocol + /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py:496: in _call_chain result = func(*args) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py:1391: in https_open return self.do_open(http.client.HTTPSConnection, req, /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py:1351: in do_open raise URLError(err) E urllib.error.URLError: tests/dataset_builders/pie/aae2/test_aae2.py:None (tests/dataset_builders/pie/aae2/test_aae2.py)/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py:1348: in do_open h.request(req.get_method(), req.selector, req.data, headers, /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py:1282: in request self._send_request(method, url, body, headers, encode_chunked) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py:1328: in _send_request self.endheaders(body, encode_chunked=encode_chunked) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py:975: in send self.connect() /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py:1454: in connect self.sock = self._context.wrap_socket(self.sock, /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py:512: in wrap_socket return self.sslsocket_class._create( /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py:1070: in _create self.do_handshake() /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py:1341: in do_handshake self._sslobj.do_handshake() E ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997) During handling of the above exception, another exception occurred: tests/dataset_builders/pie/aae2/test_aae2.py:14: in from dataset_builders.pie.aae2.aae2 import ( dataset_builders/pie/aae2/aae2.py:29: in SPLIT_PATHS = get_split_paths(URL_SPLIT_IDS, subdirectory="brat-project-final") dataset_builders/pie/aae2/aae2.py:19: in get_split_paths df_splits = pd.read_csv(url_split_ids, sep=";") ../../../Library/Caches/pypoetry/virtualenvs/pie-datasets-HpQTGuq4-py3.10/lib/python3.10/site-packages/pandas/io/parsers/readers.py:1026: in read_csv return _read(filepath_or_buffer, kwds) ../../../Library/Caches/pypoetry/virtualenvs/pie-datasets-HpQTGuq4-py3.10/lib/python3.10/site-packages/pandas/io/parsers/readers.py:620: in _read parser = TextFileReader(filepath_or_buffer, **kwds) ../../../Library/Caches/pypoetry/virtualenvs/pie-datasets-HpQTGuq4-py3.10/lib/python3.10/site-packages/pandas/io/parsers/readers.py:1620: in __init__ self._engine = self._make_engine(f, self.engine) ../../../Library/Caches/pypoetry/virtualenvs/pie-datasets-HpQTGuq4-py3.10/lib/python3.10/site-packages/pandas/io/parsers/readers.py:1880: in _make_engine self.handles = get_handle( ../../../Library/Caches/pypoetry/virtualenvs/pie-datasets-HpQTGuq4-py3.10/lib/python3.10/site-packages/pandas/io/common.py:728: in get_handle ioargs = _get_filepath_or_buffer( ../../../Library/Caches/pypoetry/virtualenvs/pie-datasets-HpQTGuq4-py3.10/lib/python3.10/site-packages/pandas/io/common.py:384: in _get_filepath_or_buffer with urlopen(req_info) as req: ../../../Library/Caches/pypoetry/virtualenvs/pie-datasets-HpQTGuq4-py3.10/lib/python3.10/site-packages/pandas/io/common.py:289: in urlopen return urllib.request.urlopen(*args, **kwargs) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py:216: in urlopen return opener.open(url, data, timeout) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py:519: in open response = self._open(req, data) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py:536: in _open result = self._call_chain(self.handle_open, protocol, protocol + /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py:496: in _call_chain result = func(*args) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py:1391: in https_open return self.do_open(http.client.HTTPSConnection, req, /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py:1351: in do_open raise URLError(err) E urllib.error.URLError: ```

I did the following to solve it: Executed Install Certificates.command from the Python 3.X in the application directory on macOS (Source: https://stackoverflow.com/questions/52805115/certificate-verify-failed-unable-to-get-local-issuer-certificate)