Recently after upgrading the python version to
3.6, I started getting this error every time I am running any python script.
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)>
The reason behind this is Python 3.6 on macOS uses an embedded version of OpenSSL, which does not use the system certificate store. More information here.
Quick fix for this problem on macOS is to open Finder and double-clicking
Or you can do this via terminal by:
open /Applications/Python\ 3.6/Install\ Certificates.command