I am trying my hands on SPACY library for NLP and facing issues while installing. Following are the steps taken:
!pip3 install spacy
!python -m spacy download en_core_web_sm
I am getting following errors.
What needs to be done to fix it?
2021-03-10 14:12:10.063797: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2021-03-10 14:12:10.064255: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connection.py", line 411, in connect
self.sock = ssl_wrap_socket(
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\util\ssl_.py", line 428, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\util\ssl_.py", line 472, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1040, in _create
self.do_handshake()
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\util\retry.py", line 573, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /explosion/spacy-models/master/compatibility.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\spacy\__main__.py", line 4, in <module>
setup_cli()
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\spacy\cli\_util.py", line 68, in setup_cli
command(prog_name=COMMAND)
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\click\core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\typer\main.py", line 497, in wrapper
return callback(**use_params) # type: ignore
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\spacy\cli\download.py", line 35, in download_cli
download(model, direct, sdist, *ctx.args)
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\spacy\cli\download.py", line 67, in download
compatibility = get_compatibility()
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\spacy\cli\download.py", line 78, in get_compatibility
r = requests.get(about.__compatibility__)
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Users\bj\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /explosion/spacy-models/master/compatibility.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))
I also tried this option, but this is not working:
PS C:\Users\bj> pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.1.0/en_core_web_sm-2.1.0.tar.gz
ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='github-releases.githubusercontent.com', port=443): Max retries exceeded with url: /84940268/85ec3200-48aa-11e9-9878-337412e36828?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210310%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210310T163448Z&X-Amz-Expires=300&X-Amz-Signature=1f872d0cc838d305c2ab952ec0a685a22a62894f38e0bd03b6920692d9755cce&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=84940268&response-content-disposition=attachment%3B%20filename%3Den_core_web_sm-2.1.0.tar.gz&response-content-type=application%2Foctet-stream (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))
Python version 3.8, Windows 10
Add https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0.tar.gz to your requirements.txt file.
Next, install using pip3 install --trusted-host files.pythonhosted.org --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host github.com -r requirements.txt
Related
I am attempting to scrape text off of websites, and I am using the requests module to do so.
With the code
response = requests.get('https://kjt.hebei.gov.cn/www/index_ssl/index.html', verify=False)
I receive back the following error:
Traceback (most recent call last):
File "E:\new_work\venv.spider\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "E:\new_work\venv.spider\lib\site-packages\urllib3\connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "E:\new_work\venv.spider\lib\site-packages\urllib3\connectionpool.py", line 1042, in _validate_conn
conn.connect()
File "E:\new_work\venv.spider\lib\site-packages\urllib3\connection.py", line 414, in connect
self.sock = ssl_wrap_socket(
File "E:\new_work\venv.spider\lib\site-packages\urllib3\util\ssl_.py", line 449, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(
File "E:\new_work\venv.spider\lib\site-packages\urllib3\util\ssl_.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Python39\lib\ssl.py", line 501, in wrap_socket
return self.sslsocket_class._create(
File "C:\Python39\lib\ssl.py", line 1041, in _create
self.do_handshake()
File "C:\Python39\lib\ssl.py", line 1310, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: BAD_ECPOINT] bad ecpoint (_ssl.c:1129)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\new_work\venv.spider\lib\site-packages\requests\adapters.py", line 489, in send
resp = conn.urlopen(
File "E:\new_work\venv.spider\lib\site-packages\urllib3\connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "E:\new_work\venv.spider\lib\site-packages\urllib3\util\retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='kjt.hebei.gov.cn', port=443): Max retries exceeded with url: /www/index_ssl/index.html (Caused by SSLError(SSLError(1, '[SSL: BAD_ECPOINT] bad ecpoint (_ssl.c:1129)')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\new_work\innocom\innocom\scripts\__init__.py", line 44, in <module>
response = requests.get('https://kjt.hebei.gov.cn/www/index_ssl/index.html', verify=False)
File "E:\new_work\venv.spider\lib\site-packages\requests\api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "E:\new_work\venv.spider\lib\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "E:\new_work\venv.spider\lib\site-packages\requests\sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "E:\new_work\venv.spider\lib\site-packages\requests\sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "E:\new_work\venv.spider\lib\site-packages\requests\adapters.py", line 563, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='kjt.hebei.gov.cn', port=443): Max retries exceeded with url: /www/index_ssl/index.html (Caused by SSLError(SSLError(1, '[SSL: BAD_ECPOINT] bad ecpoint (_ssl.c:1129)')))
There was no more i can find about bad ecpoint, I had installed some packages:
anyio 3.6.2
certifi 2020.12.5
cffi 1.15.1
charset-normalizer 2.0.12
cryptography 38.0.3
h11 0.12.0
httpcore 0.15.0
httpx 0.23.0
idna 3.4
pip 22.0.4
pycparser 2.21
pyOpenSSL 22.1.0
requests 2.28.1
rfc3986 1.5.0
setuptools 58.1.0
six 1.16.0
sniffio 1.3.0
urllib3 1.26.12
I changed the version of pyOpenSSL, urllib3, certifi to others, but it did not work.
By the way, I ues python3.9 in windows 10. However, with the same code, it work with python3.6.
And with python3.9, requests.get work for other https url. It just not work for https://kjt.hebei.gov.cn/www/index_ssl/index.html.
Any help would be greatly appreciated! Thank you!
I have installed and imported the twitter package in python. After initializing a Twitter class instance as t this is what I tried.
>>> t.statuses.home_timeline
<twitter.api.TwitterCall object at 0x10646e160>
>>> print(t.statuses.home_timeline)
<twitter.api.TwitterCall object at 0x106d1f2e0>
>>> t.statuses.home_timeline()
The last line returned the following -
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1319, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1230, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1276, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1225, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1004, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 944, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1399, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/twitter/api.py", line 334, in __call__
return self._handle_response(req, uri, arg_data, _timeout)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/twitter/api.py", line 341, in _handle_response
handle = urllib_request.urlopen(req, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1362, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1322, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)>
I am unable to resolve this. Also, I tried searching for a similar question but couldn't get it in case it is already there I apologise for the trouble.
Config -
MacOS Catalina 10.15.4
The error comes up in Python3.8, no such problem in Python2.7(the default python on my machine)
Note:
Have tried using pip install certifi for the python3 version and pip gives me a message saying "Requirement already satisfied". Also checked the folders in python3 and found a directory called etc with a folder openssl in it. OpenSSL folder itself was empty.
To fix this issue run command:
pip install certifi
Edit: For Mac OS users, go in the Applications folder and expand the Python folder. Now first run (or double click) the Install Certificates.command and then Update Shell Profile.command
I'm following this tutorial but when I get to the $VENV/bin/pip install "pyramid==1.10.1" waitress it gives me the following error:
Could not find a version that satisfies the requirement pyramid==1.10.1 (from versions: )
No matching distribution found for pyramid==1.10.1
I'm using a macSierra 10.13.5 running python 3.5.1 (under python3). I can see the package exists on pip because when I try to install in my machine it works. But it won't work when installing inside the virtual environment.
Can you help me, please? I'm going through this tutorial to understand how to run a legacy project I'll have to work on.
UPDATE:
the output when running $VENV/bin/pip install "pyramid==1.10.1" -vvv
Collecting pyramid==1.10.1
Getting page https://pypi.python.org/simple/pyramid/
Starting new HTTPS connection (1): pypi.org
Could not fetch URL https://pypi.python.org/simple/pyramid/: connection error: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) - skipping
1 location(s) to search for versions of pyramid:
* https://pypi.python.org/simple/pyramid/
Getting page https://pypi.python.org/simple/pyramid/
Starting new HTTPS connection (2): pypi.org
Could not fetch URL https://pypi.python.org/simple/pyramid/: connection error: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) - skipping
Could not find a version that satisfies the requirement pyramid==1.10.1 (from versions: )
Cleaning up...
No matching distribution found for pyramid==1.10.1
Exception information:
Traceback (most recent call last):
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/commands/install.py", line 294, in run
requirement_set.prepare_files(finder)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/req/req_set.py", line 334, in prepare_files
functools.partial(self._prepare_file, finder))
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/req/req_set.py", line 321, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/req/req_set.py", line 461, in _prepare_file
req_to_install.populate_link(finder, self.upgrade)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/req/req_install.py", line 250, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/index.py", line 571, in find_requirement
'No matching distribution found for %s' % req
pip.exceptions.DistributionNotFound: No matching distribution found for pyramid==1.10.1
Starting new HTTPS connection (1): pypi.org
There was an error checking the latest version of pip
Traceback (most recent call last):
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 544, in urlopen
body=body, headers=headers)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 341, in _make_request
self._validate_conn(conn)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 761, in _validate_conn
conn.connect()
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connection.py",line 238, in connect
ssl_version=resolved_ssl_version)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py", line 279, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 376, in wrap_socket
_context=self)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 747, in __init__
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 983, in do_handshake
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 628, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/adapters.py", line 370, in send
timeout=timeout
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 574, in urlopen
raise SSLError(e)
pip._vendor.requests.packages.urllib3.exceptions.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/utils/outdated.py", line 126, in pip_version_check
headers={"Accept": "application/json"},
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py", line 477, in get
return self.request('GET', url, **kwargs)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/download.py", line 373, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py", line 465, in request
resp = self.send(prep, **send_kwargs)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py", line 594, in send
history = [resp for resp in gen] if allow_redirects else []
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py", line 594, in <listcomp>
history = [resp for resp in gen] if allow_redirects else []
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py", line 196, in resolve_redirects
**adapter_kwargs
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/cachecontrol/adapter.py", line 46, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/adapters.py", line 431, in send
raise SSLError(e, request=request)
pip._vendor.requests.exceptions.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645)
You need to use the get-pip [1] script to install a newer version of pip. Yours is outdated enough that it can no longer talk to PyPI due to security upgrades over the past few years. This means that your version of pip is old enough that it cannot upgrade itself via pip install -U pip. You'll need to use the get-pip script.
https://packaging.python.org/tutorials/installing-packages/#ensure-you-can-run-pip-from-the-command-line
I'm trying to install Python 3.6 from source on Ubuntu 16.10.
make test
when I make test, the installation raises an error saying..
======================================================================
ERROR: test_logincapa_with_client_certfile (test.test_imaplib.RemoteIMAP_SSLTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/anderson/Downloads/Python-3.6.1/Lib/test/test_imaplib.py", line 973, in test_logincapa_with_client_certfile
certfile=CERTFILE)
File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 1280, in __init__
IMAP4.__init__(self, host, port)
File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 197, in __init__
self.open(host, port)
File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 1293, in open
IMAP4.open(self, host, port)
File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 294, in open
self.sock = self._create_socket()
File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 1285, in _create_socket
server_hostname=self.host)
File "/home/anderson/Downloads/Python-3.6.1/Lib/ssl.py", line 401, in wrap_socket
_context=self, _session=session)
File "/home/anderson/Downloads/Python-3.6.1/Lib/ssl.py", line 808, in __init__
self.do_handshake()
File "/home/anderson/Downloads/Python-3.6.1/Lib/ssl.py", line 1061, in do_handshake
self._sslobj.do_handshake()
File "/home/anderson/Downloads/Python-3.6.1/Lib/ssl.py", line 683, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:749)
======================================================================
ERROR: test_logincapa_with_client_ssl_context (test.test_imaplib.RemoteIMAP_SSLTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/anderson/Downloads/Python-3.6.1/Lib/test/test_imaplib.py", line 979, in test_logincapa_with_client_ssl_context
self.host, self.port, ssl_context=self.create_ssl_context())
File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 1280, in __init__
IMAP4.__init__(self, host, port)
File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 197, in __init__
self.open(host, port)
File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 1293, in open
IMAP4.open(self, host, port)
File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 294, in open
self.sock = self._create_socket()
File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 1285, in _create_socket
server_hostname=self.host)
File "/home/anderson/Downloads/Python-3.6.1/Lib/ssl.py", line 401, in wrap_socket
_context=self, _session=session)
File "/home/anderson/Downloads/Python-3.6.1/Lib/ssl.py", line 808, in __init__
self.do_handshake()
File "/home/anderson/Downloads/Python-3.6.1/Lib/ssl.py", line 1061, in do_handshake
self._sslobj.do_handshake()
File "/home/anderson/Downloads/Python-3.6.1/Lib/ssl.py", line 683, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:749)
----------------------------------------------------------------------
Ran 95 tests in 21.126s
FAILED (errors=2)
test test_imaplib failed
1 test failed again:
test_imaplib
Total duration: 3 min 9 sec
Tests result: FAILURE
Makefile:1018: recipe for target 'test' failed
make: *** [test] Error 1
what's the problem?
it seems that this code you specify doesn't exist on previous or newer branches.
however this specific error says the CA is not a valid (trusted) CA.
checking the specific code it seems that the key is keycert3.pem in the lib/test folder.
The CA file is pycacert.pem, you can add this CA to be trusted by your machine. you can see answers on superuser like https://superuser.com/questions/437330/how-do-you-add-a-certificate-authority-ca-to-ubuntu
that specify how to do it although i seem to remember that simply copying the file into /etc/ssl/certs should be enough.
hope it helps.
First of all, install Python 3.6 from their official website:
cd /opt
sudo wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
then unpack it
sudo tar -xvf Python-3.6.3.tgz
This should work for you!
I'm running OS X El Capitan on Python 3.5.2 via Anaconda and have spaCy 0.101.0.
I'm trying to install the spaCy English language model using python -m spacy.en.download. However when I do that, I get an error that says urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)>. The complete Traceback is as follows:
Traceback (most recent call last):
File "/Users/bsherman/anaconda/lib/python3.5/urllib/request.py", line 1254, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/Users/bsherman/anaconda/lib/python3.5/http/client.py", line 1106, in request
self._send_request(method, url, body, headers)
File "/Users/bsherman/anaconda/lib/python3.5/http/client.py", line 1151, in _send_request
self.endheaders(body)
File "/Users/bsherman/anaconda/lib/python3.5/http/client.py", line 1102, in endheaders
self._send_output(message_body)
File "/Users/bsherman/anaconda/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/Users/bsherman/anaconda/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/Users/bsherman/anaconda/lib/python3.5/http/client.py", line 1260, in connect
server_hostname=server_hostname)
File "/Users/bsherman/anaconda/lib/python3.5/ssl.py", line 377, in wrap_socket
_context=self)
File "/Users/bsherman/anaconda/lib/python3.5/ssl.py", line 752, in __init__
self.do_handshake()
File "/Users/bsherman/anaconda/lib/python3.5/ssl.py", line 988, in do_handshake
self._sslobj.do_handshake()
File "/Users/bsherman/anaconda/lib/python3.5/ssl.py", line 633, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/bsherman/anaconda/lib/python3.5/runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "/Users/bsherman/anaconda/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/bsherman/anaconda/lib/python3.5/site-packages/spacy/en/download.py", line 13, in <module>
plac.call(main)
File "/Users/bsherman/anaconda/lib/python3.5/site-packages/plac_core.py", line 328, in call
cmd, result = parser.consume(arglist)
File "/Users/bsherman/anaconda/lib/python3.5/site-packages/plac_core.py", line 207, in consume
return cmd, self.func(*(args + varargs + extraopts), **kwargs)
File "/Users/bsherman/anaconda/lib/python3.5/site-packages/spacy/en/download.py", line 9, in main
download('en', force)
File "/Users/bsherman/anaconda/lib/python3.5/site-packages/spacy/download.py", line 24, in download
package = sputnik.install(about.__title__, about.__version__, about.__models__[lang])
File "/Users/bsherman/anaconda/lib/python3.5/site-packages/sputnik/__init__.py", line 37, in install
index.update()
File "/Users/bsherman/anaconda/lib/python3.5/site-packages/sputnik/index.py", line 84, in update
index = json.load(session.open(request, 'utf8'))
File "/Users/bsherman/anaconda/lib/python3.5/site-packages/sputnik/session.py", line 43, in open
r = self.opener.open(request)
File "/Users/bsherman/anaconda/lib/python3.5/urllib/request.py", line 466, in open
response = self._open(req, data)
File "/Users/bsherman/anaconda/lib/python3.5/urllib/request.py", line 484, in _open
'_open', req)
File "/Users/bsherman/anaconda/lib/python3.5/urllib/request.py", line 444, in _call_chain
result = func(*args)
File "/Users/bsherman/anaconda/lib/python3.5/urllib/request.py", line 1297, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/Users/bsherman/anaconda/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)>
Run in terminal:
/Applications/Python 3.5.2/Install Certificates.command
or update certifi package via pip
I've come cross this issue several times before and pip install pip-system-certs did the trick for me.
https://pypi.org/project/pip-system-certs/