Skip to content

setup downloads sometimes fails CERTIFICATE_VERIFY_FAILED #14169

Closed
@zerothi

Description

@zerothi

Bug report

Sometimes (depending on how Python has been installed) one might see a

<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)>

error.

Fix

The easy fix is to ensure certifi certificates path is added to the urlopen method.

I.e. in your setupext.py you may need:

import certifi
    with urlopen(
            Request(url, headers={"User-Agent": ""}), cafile=certifi.where()) as req:
        file_contents = BytesIO(req.read())

Probably there needs to be some try-execpt-(import certifi-fix) to handle this.

Matplotlib version

This happens when setup.py tries to download files, e.g. the recent change to jquery download. So basically I have only seen this in 2.2.4 and 3.0.3.

Agreed, this may be because my installation is not the same as system installations, but it may happen elsewhere I guess.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions