[SSL: CERTIFICATE_VERIFY_FAILED] when executing python -m spacy.en.download
See original GitHub issueHi,
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.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:5
- Comments:32 (5 by maintainers)
Top GitHub 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 pipHey!
I was just experimenting with SSL options and eureka! Found a hacky solution.
C:\Program Files\Python35\Lib\site-packages\sputnik
or where ever the sputnik is installed.session.py
import ssl
to the importsssl._create_default_https_context = ssl._create_unverified_context
just before ther = 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.