"URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed" problem solved


foreword

When using Docker to build a deep learning environment, such an error occurs, so I am looking for a solution.


1. Basic concepts

When urlopen https needs to verify the SSL certificate, when the network uses a self-signed certificate, an error will be reported.

2. Operation steps

In the Python script, add the following code

ssl._create_default_https_context = ssl._create_unverified_context

Run it again, problem solved.


Summarize

When using Docker to build a deep learning environment, an SSL error occurs, and the solution is as above.

Guess you like

Origin blog.csdn.net/szylight2022/article/details/127785855