alexandrainst / danlp

DaNLP is a repository for Natural Language Processing resources for the Danish Language.
BSD 3-Clause "New" or "Revised" License
196 stars 33 forks source link

download.download_dataset() throws [SSL: CERTIFICATE_VERIFY_FAILED] on MAC OS with python 3.6/3.7 #12

Closed Lasmali closed 2 years ago

Lasmali commented 5 years ago

When trying to download datasets on MAC OS using python 3.6/3.7, the system throws a [SSL: CERTIFICATE_VERIFY_FAILED].

Apparently the error comes from python 3.6 not being supplied with the now depreciated Apple-supplied OpenSSL library. It now comes with its own copy of OpenSSL 1.0.2, which does not use the MAC OS keychains by default. A quick fix is running the following command in the terminal.

/Applications/Python\ 3.6/Install\ Certificates.command

More info here: stackoverflow/urllib-and-ssl-certificate-verify-failed-error

Lasmali commented 5 years ago

If the error is thrown, the user will have to delete the corresponding data folder saved in "dataset_dir" (e.g. "/user/.danlp/wikiann/"), otherwise the download.download_data(**kwargs) will fail (silently if verbose=false") by skipping the if statement wherein the downloading of the data is called.