AttributeError: 'module' object has no attribute '_create_unverified_context'
Emily Wong
I got the following error
AttributeError: 'module' object has no attribute '_create_unverified_context'.
I'm using Python 3.4.2 .
My code:
import ssl
ssl._create_default_https_context = ssl._create_unverified_contextWhen I run this code, the error happens._create_unverified_context can be used in Python 3.4.2, so I really cannot understand why this error happens. How should I fix this?
Traceback says
Traceback (most recent call last): File "quickstart.py", line 3, in <module> ssl._create_default_https_context = ssl._create_unverified_context()
AttributeError: 'module' object has no attribute '_create_unverified_context' 2 Answers
Are you sure _create_verified_context is an attribute and not a method? Have you tried:
import ssl
ssl._create_default_https_context = ssl._create_unverified_context() 6 This error occurs if:
- python version is less than 2.7 i
if the module being used isn't compatible with the python version being used
Faced same issue when using module "pysphere" with python 2.7.3.
Just commenting out the line "ssl._create_default_https_context = ssl._create_unverified_context()" in the piece of code i had, worked.