Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load_krebsregister() fails with [SSL: CERTIFICATE_VERIFY_FAILED] #42

Closed
mkdeak opened this issue Sep 6, 2017 · 13 comments
Closed

load_krebsregister() fails with [SSL: CERTIFICATE_VERIFY_FAILED] #42

mkdeak opened this issue Sep 6, 2017 · 13 comments

Comments

@mkdeak
Copy link

mkdeak commented Sep 6, 2017

Hi,

Following the readthedocs documentations, I get the following error when I try to load the krebs register:

>>> krebs_data, krebs_match = load_krebsregister(missing_values=0)
Start downloading the data.
Issue with downloading the data: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)>
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/user/Library/Python/3.6/lib/python/site-packages/recordlinkage/datasets/external.py", line 75, in load_krebsregister
    data = pandas.concat([_krebsregister_block(bl) for bl in block])
  File "/Users/user/Library/Python/3.6/lib/python/site-packages/recordlinkage/datasets/external.py", line 75, in <listcomp>
    data = pandas.concat([_krebsregister_block(bl) for bl in block])
  File "/Users/user/Library/Python/3.6/lib/python/site-packages/recordlinkage/datasets/external.py", line 123, in _krebsregister_block
    compression='zip')
  File "/Users/user/Library/Python/3.6/lib/python/site-packages/pandas/io/parsers.py", line 655, in parser_f
    return _read(filepath_or_buffer, kwds)
  File "/Users/user/Library/Python/3.6/lib/python/site-packages/pandas/io/parsers.py", line 405, in _read
    parser = TextFileReader(filepath_or_buffer, **kwds)
  File "/Users/user/Library/Python/3.6/lib/python/site-packages/pandas/io/parsers.py", line 764, in __init__
    self._make_engine(self.engine)
  File "/Users/user/Library/Python/3.6/lib/python/site-packages/pandas/io/parsers.py", line 985, in _make_engine
    self._engine = CParserWrapper(self.f, **self.options)
  File "/Users/user/Library/Python/3.6/lib/python/site-packages/pandas/io/parsers.py", line 1605, in __init__
    self._reader = parsers.TextReader(src, **kwds)
  File "pandas/_libs/parsers.pyx", line 394, in pandas._libs.parsers.TextReader.__cinit__ (pandas/_libs/parsers.c:4209)
  File "pandas/_libs/parsers.pyx", line 664, in pandas._libs.parsers.TextReader._setup_parser_source (pandas/_libs/parsers.c:8001)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/zipfile.py", line 1082, in __init__
    self.fp = io.open(file, filemode)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/user/Library/Python/3.6/lib/python/site-packages/recordlinkage/datasets/krebsregister/block_1.zip'

If there's an easy way to fix this, I'd be happy to create PR with the fix.

@J535D165
Copy link
Owner

J535D165 commented Sep 6, 2017

Thanks for reporting this issue. Quite some info on the internet about this problem (https://access.redhat.com/articles/2039753).

I did change https:// to http:// in commit 30312c0. Does this solve your issue?

@twilight2001
Copy link

twilight2001 commented Nov 6, 2017

I also have problem with this line, but I get a "ValueError: Unrecognised compression type: zip" error instead ... the error is different from the above: (this is on Win 7 Pro, 64 bit, running Anaconda)

krebs_data, krebs_match = load_krebsregister(missing_values=0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\user\AppData\Roaming\Python\Python27\site-packages\recordlinkag
e\datasets\external.py", line 75, in load_krebsregister
    data = pandas.concat([_krebsregister_block(bl) for bl in block])
  File "C:\Users\user\AppData\Roaming\Python\Python27\site-packages\recordlinkag
e\datasets\external.py", line 123, in _krebsregister_block
    compression='zip')
  File "C:\Anaconda2\lib\site-packages\pandas\io\parsers.py", line 529, in parse
r_f
    return _read(filepath_or_buffer, kwds)
  File "C:\Anaconda2\lib\site-packages\pandas\io\parsers.py", line 295, in _read

    parser = TextFileReader(filepath_or_buffer, **kwds)
  File "C:\Anaconda2\lib\site-packages\pandas\io\parsers.py", line 612, in __ini
t__
    self._make_engine(self.engine)
  File "C:\Anaconda2\lib\site-packages\pandas\io\parsers.py", line 747, in _make
_engine
    self._engine = CParserWrapper(self.f, **self.options)
  File "C:\Anaconda2\lib\site-packages\pandas\io\parsers.py", line 1119, in __in
it__
    self._reader = _parser.TextReader(src, **kwds)
  File "pandas\parser.pyx", line 353, in pandas.parser.TextReader.__cinit__ (pan
das\parser.c:3246)
  File "pandas\parser.pyx", line 567, in pandas.parser.TextReader._setup_parser_
source (pandas\parser.c:5787)
ValueError: Unrecognized compression type: zip

@J535D165
Copy link
Owner

J535D165 commented Nov 6, 2017

Can you show the output of

import pandas
pandas.show_versions()

It looks like an issue with your installation of pandas. Can you read a zipped csv file with pandas.read_csv('yourfile_csv.zip")?

@twilight2001
Copy link

twilight2001 commented Nov 6, 2017 via email

@twilight2001
Copy link

twilight2001 commented Nov 6, 2017 via email

@twilight2001
Copy link

twilight2001 commented Nov 6, 2017 via email

@twilight2001
Copy link

twilight2001 commented Nov 7, 2017 via email

@J535D165 J535D165 closed this as completed Jan 4, 2018
@Michael-E-Rose
Copy link

Problem prevails with recordlinkage version 0.11.2

>>> from recordlinkage.datasets import load_krebsregister
>>> krebs_data, krebs_match = load_krebsregister(missing_values=0)
Start downloading the data.
Issue with downloading the data: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/recordlinkage/datasets/krebsregister/block_10.zip'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/recordlinkage/datasets/external.py", line 75, in load_krebsregister
    data = pandas.concat([_krebsregister_block(bl) for bl in block])
  File "/usr/local/lib/python3.5/dist-packages/recordlinkage/datasets/external.py", line 75, in <listcomp>
    data = pandas.concat([_krebsregister_block(bl) for bl in block])
  File "/usr/local/lib/python3.5/dist-packages/recordlinkage/datasets/external.py", line 123, in _krebsregister_block
    compression='zip')
  File "/usr/local/lib/python3.5/dist-packages/pandas/io/parsers.py", line 709, in parser_f
    return _read(filepath_or_buffer, kwds)
  File "/usr/local/lib/python3.5/dist-packages/pandas/io/parsers.py", line 449, in _read
    parser = TextFileReader(filepath_or_buffer, **kwds)
  File "/usr/local/lib/python3.5/dist-packages/pandas/io/parsers.py", line 818, in __init__
    self._make_engine(self.engine)
  File "/usr/local/lib/python3.5/dist-packages/pandas/io/parsers.py", line 1049, in _make_engine
    self._engine = CParserWrapper(self.f, **self.options)
  File "/usr/local/lib/python3.5/dist-packages/pandas/io/parsers.py", line 1695, in __init__
    self._reader = parsers.TextReader(src, **kwds)
  File "pandas/_libs/parsers.pyx", line 402, in pandas._libs.parsers.TextReader.__cinit__
  File "pandas/_libs/parsers.pyx", line 664, in pandas._libs.parsers.TextReader._setup_parser_source
  File "/usr/lib/python3.5/zipfile.py", line 1009, in __init__
    self.fp = io.open(file, filemode)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.5/dist-packages/recordlinkage/datasets/krebsregister/block_1.zip'

@J535D165
Copy link
Owner

Hello, this is a different issue. You do not have permission to write /usr/local/lib/python3.5/dist-packages/recordlinkage/datasets/krebsregister/block_10.zip.

Is it possible to get write access?

@Michael-E-Rose
Copy link

Yes it is, I invoked python3 with sudo. I wasn't aware of what the problem was in this case.

Thanks for the help!

@Dragut
Copy link

Dragut commented Mar 27, 2019

I encountered the same problem when doing the load:
krebs_X, krebs_true_links = load_krebsregister(missing_values=0)
Error Message:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\s59018\AppData\Roaming\Python\Python36\site-packages\recordlinkage\datasets\krebsregister\block_1.zip'
Please help.

@J535D165
Copy link
Owner

This is a permission error. Do you have permission to the given folder?

I will work on a permanent solution.

@J535D165 J535D165 reopened this Mar 27, 2019
@Dragut
Copy link

Dragut commented Mar 27, 2019

I rerun it successfully from home rather than in the office. Looks like a connection problem which fails to download the data completely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants