... [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
Above isn't a solution to your specific problem, but I'm putting it here because this thread is the top Google result for "SSL: CERTIFICATE_VERIFY_FAILED", and it lead me on a wild goose chase.
If you have installed Python 3.6 on OSX and are getting the "SSL: CERTIFICATE_VERIFY_FAILED" error when trying to connect to an https:// site, it's probably because Python 3.6 on OSX has no certificates at all, and can't validate any SSL connections. This is a change for 3.6 on OSX, and requires a post-install step, which installs the certifi package of certificates. This is documented in the ReadMe, which you should find at /Applications/Python\ 3.6/ReadMe.rtf
The ReadMe will have you run this post-install script, which just installs certifi:
$ /Applications/Python\ 3.6/Install\ Certificates.command
For MacOS :
$ cd "/Applications/Python 3.6/"
$ "./Install Certificates.command"
Release notes have some more info: https://www.python.org/downloads/release/python-360/