Downloading mnist data
Hi Aurélien: I am trying to download the mnist dataset as used in your book (chapter 3). I am using python version 3.8 and sklearn.version '0.24.0'
But I get this error:
from sklearn.datasets import fetch_openml
...: mnist = fetch_openml('mnist_784', version=1, cache=True)
/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/sklearn/datasets/_openml.py:65: RuntimeWarning: Invalid cache, redownloading file
warn("Invalid cache, redownloading file", RuntimeWarning)
---------------------------------------------------------------------------
SSLCertVerificationError Traceback (most recent call last)
And then I am attaching the last line of this error:
URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1125)>
Any ideas what I am doing wrong? Thanks for your help!
I now realize that I get this error whenever I am using fetch_openml. So this example also gives me error:
mice = fetch_openml(name='miceprotein', version=4)
This has something to do with the SSL error. How do I fix this?
Thanks for your question.
Generally, when people have SSL issues when using Python on MacOSX, it's due to a missing step when installing Python: installing the SSL certificates. You need to run this script :
/Applications/Python\ 3.8/Install\ Certificates.command
Also, I recommend you use Python 3.7 instead of Python 3.8, as some TensorFlow libraries don't support Python 3.8 yet.
Hope this helps.
I had the same issue. I couldn't find Aurélien's script in my system, but Jia's answer from this thread worked for me: https://stackoverflow.com/questions/35569042/ssl-certificate-verify-failed-with-python3?rq=4