cvangysel / pytrec_eval

pytrec_eval is an Information Retrieval evaluation tool for Python, based on the popular trec_eval.
http://ilps.science.uva.nl/
MIT License
282 stars 32 forks source link

issue with pip install in mac #20

Closed Ali-H-Vahid closed 3 years ago

Ali-H-Vahid commented 4 years ago

Hi there, I am getting following error when I try to install pytrec_eval either using pip install or when trying to install python-terrier:


Collecting pytrec_eval Using cached pytrec_eval-0.4.tar.gz (11 kB) ERROR: Command errored out with exit status 1: command: /Users/ali.vahid/project_pyTerrier/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/pb/b4bbdkcn11x0b_2nsvl7kzjh0000gn/T/pip-install-os9v0s7h/pytrec-eval/setup.py'"'"'; file='"'"'/private/var/folders/pb/b4bbdkcn11x0b_2nsvl7kzjh0000gn/T/pip-install-os9v0s7h/pytrec-eval/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/pb/b4bbdkcn11x0b_2nsvl7kzjh0000gn/T/pip-install-os9v0s7h/pytrec-eval/pip-egg-info cwd: /private/var/folders/pb/b4bbdkcn11x0b_2nsvl7kzjh0000gn/T/pip-install-os9v0s7h/pytrec-eval/ Complete output (43 lines): 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 "<string>", line 1, in <module>
  File "/private/var/folders/pb/b4bbdkcn11x0b_2nsvl7kzjh0000gn/T/pip-install-os9v0s7h/pytrec-eval/setup.py", line 28, in <module>
    response = urllib.request.urlopen(REMOTE_TREC_EVAL_ZIP)
  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)>
Fetching trec_eval from https://github.com/usnistgov/trec_eval/archive/v9.0.5.zip.
----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

cmacdonald commented 4 years ago

is the date/time on your machine wrong? doesnt seem like a pytrec_eval issue, its Python complaining about github's certificate.

cash commented 3 years ago

@Ali-H-Vahid I know this error! Most likely you are behind an SSL proxy so rather than getting NIST's SSL certificate, you are getting the certificate of the proxy which is not trusted by urllib.request.

Probably the easiest work around is to clone this repository with the --recurse-submodules flag to also pull down the trec_eval code and then run pip install .