spaCy: [SSL: CERTIFICATE_VERIFY_FAILED] when executing python -m spacy.en.download

Hi,

I am receiving the error pasted bellow when executing the command ‘python -m spacy.en.download’

File "/usr/local/lib/python3.5/runpy.py", line 184, in _run_module_as_main "__main__", mod_spec) File "/usr/local/lib/python3.5/runpy.py", line 85, in _run_code exec(code, run_globals) File "/root/.virtualenvs/jordipala_pfc/lib/python3.5/site-packages/spacy/en/download.py", line 13, in <module> plac.call(main) File "/root/.virtualenvs/jordipala_pfc/lib/python3.5/site-packages/plac_core.py", line 328, in call cmd, result = parser.consume(arglist) File "/root/.virtualenvs/jordipala_pfc/lib/python3.5/site-packages/plac_core.py", line 207, in consume return cmd, self.func(*(args + varargs + extraopts), **kwargs) File "/root/.virtualenvs/jordipala_pfc/lib/python3.5/site-packages/spacy/en/download.py", line 9, in main download('en', force) File "/root/.virtualenvs/jordipala_pfc/lib/python3.5/site-packages/spacy/download.py", line 24, in download package = sputnik.install(about.__title__, about.__version__, about.__models__[lang]) File "/root/.virtualenvs/jordipala_pfc/lib/python3.5/site-packages/sputnik/__init__.py", line 37, in install index.update() File "/root/.virtualenvs/jordipala_pfc/lib/python3.5/site-packages/sputnik/index.py", line 84, in update index = json.load(session.open(request, 'utf8')) File "/root/.virtualenvs/jordipala_pfc/lib/python3.5/site-packages/sputnik/session.py", line 43, in open r = self.opener.open(request) File "/usr/local/lib/python3.5/urllib/request.py", line 466, in open response = self._open(req, data) File "/usr/local/lib/python3.5/urllib/request.py", line 484, in _open '_open', req) File "/usr/local/lib/python3.5/urllib/request.py", line 444, in _call_chain result = func(*args) File "/usr/local/lib/python3.5/urllib/request.py", line 1297, in https_open context=self._context, check_hostname=self._check_hostname) File "/usr/local/lib/python3.5/urllib/request.py", line 1256, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)> I’ve tried in three differents machines.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 5
  • Comments: 32 (5 by maintainers)

Most upvoted comments

This issue can be fixed by this walkthrough (it’s for Mac): http://stackoverflow.com/questions/41691327/ssl-sslerror-ssl-certificate-verify-failed-certificate-verify-failed-ssl-c/41692664

but in general - it’s simply to update certifi package via pip

Hey!

I was just experimenting with SSL options and eureka! Found a hacky solution.

  1. Visit C:\Program Files\Python35\Lib\site-packages\sputnik or where ever the sputnik is installed.
  2. Open session.py
  3. Add import ssl to the imports
  4. Add ssl._create_default_https_context = ssl._create_unverified_context just before the r = self.opener.open(request) statement.

Now it’s going to ignore all SSL errors globally. It’s still a hack and must never be used in production cases.

All working fine. Thank you 👍

On 26 September 2016 at 23:17, Ines Montani notifications@github.com wrote:

Alright, so this should be fixed now — try again?

We’ve been moving the site over to new servers and fixing the SSL certificate to finally address the model downloading issues. The problem was that @honnibal https://github.com/honnibal was using CloudFlare’s “flexible” SSL option. We now got rid of that and installed a certificate from Let’s Encrypt https://letsencrypt.org (which is great, btw!)

Make sure to flush your DNS cache before you reload and try again: In Chrome: chrome://net-internals/#dns On Mac / OSX 10.11+: sudo dscacheutil -flushcache

Alternatively, you can also use Google Public DNS https://developers.google.com/speed/public-dns/, which has already updated. That’s also what we used for debugging internally for the past few hours. Unfortunately, the DNS is still propagating and seems to be taking forever (see here http://viewdns.info/propagation/?domain=spacy.io for the current status).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/spacy-io/spaCy/issues/507#issuecomment-249700235, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYlPCzsZX44hz6cdtBmBb0vySrSS25fks5quDZkgaJpZM4KG0Dc .