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

For those with SSL issues here is the fix: #46

Open EdwardBurgin opened 11 months ago

EdwardBurgin commented 11 months ago

Heres the error message:

urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:1131)>
      Fetching trec_eval from http://github.com/usnistgov/trec_eval/archive/v9.0.8.tar.gz.

On our proxy we only have a http and https is passed through this, on newer urllib3 this I have read causes a problem. The fix creates an unsecured connection, without SSL: edit the file: /pytrec_eval/setup.py

import ssl
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE

response = urllib.request.urlopen(REMOTE_TREC_EVAL_URI, context = ctx)
colabear-info commented 9 months ago

Another solution:

download the file http://github.com/usnistgov/trec_eval/archive/v9.0.8.tar.gz somewhile else, unzip it into the root folder of the git and rename it to trec_eval.

The dataset structure will be like